unpoly-rails 0.27.2 → 0.27.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of unpoly-rails might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/dist/unpoly.js +36 -24
- data/dist/unpoly.min.js +3 -3
- data/lib/assets/javascripts/unpoly/flow.js.coffee +17 -10
- data/lib/assets/javascripts/unpoly/modal.js.coffee +4 -3
- data/lib/assets/javascripts/unpoly/popup.js.coffee +4 -3
- data/lib/unpoly/rails/version.rb +1 -1
- data/spec_app/Gemfile.lock +1 -1
- data/spec_app/spec/javascripts/helpers/reset_path.js.coffee +1 -1
- data/spec_app/spec/javascripts/up/flow_spec.js.coffee +53 -2
- data/spec_app/spec/javascripts/up/modal_spec.js.coffee +3 -1
- data/spec_app/spec/javascripts/up/motion_spec.js.coffee +1 -1
- data/spec_app/spec/javascripts/up/popup_spec.js.coffee +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d404629719d453d5e2aca5dc42043b8f2eb2edee
|
4
|
+
data.tar.gz: ee1e3c7da3506f74134521a0e34004274d0cd9d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03ded9fb08965c29e3965754ff96a1e95d384aa15da31661ee9079bfe837511332d6534aa7b6db258a5b34f8b510a9395bd560ba3cfb15abe3e8b7651e2f6c19
|
7
|
+
data.tar.gz: 5b5c82abc2089e9ea3a5ee765c8128540cd25c16f73410617b663aaa6438a5406f9669bab61056e357274d31051387306a869dbb5685cc6e2cb04c33ac83d10d
|
data/CHANGELOG.md
CHANGED
@@ -14,6 +14,22 @@ Unreleased
|
|
14
14
|
### Breaking changes
|
15
15
|
|
16
16
|
|
17
|
+
0.27.3
|
18
|
+
------
|
19
|
+
|
20
|
+
### Compatible changes
|
21
|
+
|
22
|
+
- [Popups](/up.popup) and [modals](/up.modal) will no longer try to restore a covered document title
|
23
|
+
and URL if they were opened without pushing a history entry.
|
24
|
+
- When fragments are [replaced](/up.replace) without pushing a new history entry,
|
25
|
+
the document title will no longer by changed by default.
|
26
|
+
|
27
|
+
|
28
|
+
### Breaking changes
|
29
|
+
|
30
|
+
- The `{ url }` option for [`up.destroy`](/up.destroy) has been renamed to `{ history }` to be more
|
31
|
+
in line with [`up.replace`](/up.replace).
|
32
|
+
|
17
33
|
|
18
34
|
0.27.2
|
19
35
|
------
|
data/dist/unpoly.js
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
(function() {
|
7
7
|
window.up = {
|
8
|
-
version: "0.27.
|
8
|
+
version: "0.27.3"
|
9
9
|
};
|
10
10
|
|
11
11
|
}).call(this);
|
@@ -4750,7 +4750,7 @@ are based on this module.
|
|
4750
4750
|
|
4751
4751
|
(function() {
|
4752
4752
|
up.flow = (function($) {
|
4753
|
-
var autofocus, config, destroy, emitFragmentInserted, emitFragmentKept, extract, filterScripts, findKeepPlan, findOldFragment, first, firstInLayer, firstInPriority, hello, isRealElement, layerOf, matchesLayer, oldFragmentNotFound, parseImplantSteps, parseResponse, processResponse, reload, replace, reset, resolveSelector, setSource, source, swapElements, transferKeepableElements, u, updateHistory;
|
4753
|
+
var autofocus, config, destroy, emitFragmentInserted, emitFragmentKept, extract, filterScripts, findKeepPlan, findOldFragment, first, firstInLayer, firstInPriority, hello, isRealElement, layerOf, matchesLayer, oldFragmentNotFound, parseImplantSteps, parseResponse, processResponse, reload, replace, reset, resolveSelector, setSource, shouldExtractTitle, source, swapElements, transferKeepableElements, u, updateHistory;
|
4754
4754
|
u = up.util;
|
4755
4755
|
|
4756
4756
|
/**
|
@@ -4908,6 +4908,10 @@ are based on this module.
|
|
4908
4908
|
@param {String} [options.failTarget='body']
|
4909
4909
|
The CSS selector to update if the server sends a non-200 status code.
|
4910
4910
|
@param {String} [options.title]
|
4911
|
+
The document title after the replacement.
|
4912
|
+
|
4913
|
+
If the call pushes an history entry and this option is missing, the title is extracted from the response's `<title>` tag.
|
4914
|
+
You can also pass `false` to explicitly prevent the title from being updated.
|
4911
4915
|
@param {String} [options.method='get']
|
4912
4916
|
The HTTP method to use for the request.
|
4913
4917
|
@param {Object|Array} [options.data]
|
@@ -4996,10 +5000,6 @@ are based on this module.
|
|
4996
5000
|
processResponse = function(isSuccess, selector, url, request, xhr, options) {
|
4997
5001
|
var isReloadable, newRequest, query, urlFromServer;
|
4998
5002
|
options.method = u.normalizeMethod(u.option(u.methodFromXhr(xhr), options.method));
|
4999
|
-
options.title = u.option(u.titleFromXhr(xhr), options.title);
|
5000
|
-
if (!(options.title === false || u.isString(options.title) || (options.history === false && options.title !== true))) {
|
5001
|
-
options.title = u.titleFromXhr(xhr);
|
5002
|
-
}
|
5003
5003
|
isReloadable = options.method === 'GET';
|
5004
5004
|
if (urlFromServer = u.locationFromXhr(xhr)) {
|
5005
5005
|
url = urlFromServer;
|
@@ -5047,12 +5047,18 @@ are based on this module.
|
|
5047
5047
|
options.history = false;
|
5048
5048
|
}
|
5049
5049
|
}
|
5050
|
+
if (shouldExtractTitle(options)) {
|
5051
|
+
options.title = u.titleFromXhr(xhr);
|
5052
|
+
}
|
5050
5053
|
if (options.preload) {
|
5051
5054
|
return u.resolvedPromise();
|
5052
5055
|
} else {
|
5053
5056
|
return extract(selector, xhr.responseText, options);
|
5054
5057
|
}
|
5055
5058
|
};
|
5059
|
+
shouldExtractTitle = function(options) {
|
5060
|
+
return !(options.title === false || u.isString(options.title) || (options.history === false && options.title !== true));
|
5061
|
+
};
|
5056
5062
|
|
5057
5063
|
/**
|
5058
5064
|
Updates a selector on the current page with the
|
@@ -5103,7 +5109,9 @@ are based on this module.
|
|
5103
5109
|
});
|
5104
5110
|
selector = resolveSelector(selectorOrElement, options.origin);
|
5105
5111
|
response = parseResponse(html, options);
|
5106
|
-
|
5112
|
+
if (shouldExtractTitle(options)) {
|
5113
|
+
options.title = response.title();
|
5114
|
+
}
|
5107
5115
|
if (options.saveScroll !== false) {
|
5108
5116
|
up.layout.saveScroll();
|
5109
5117
|
}
|
@@ -5195,11 +5203,14 @@ are based on this module.
|
|
5195
5203
|
};
|
5196
5204
|
};
|
5197
5205
|
updateHistory = function(options) {
|
5198
|
-
|
5199
|
-
|
5200
|
-
}
|
5206
|
+
options = u.options(options, {
|
5207
|
+
historyMethod: 'push'
|
5208
|
+
});
|
5201
5209
|
if (options.history) {
|
5202
|
-
|
5210
|
+
up.history[options.historyMethod](options.history);
|
5211
|
+
}
|
5212
|
+
if (options.title) {
|
5213
|
+
return document.title = options.title;
|
5203
5214
|
}
|
5204
5215
|
};
|
5205
5216
|
swapElements = function($old, $new, pseudoClass, transition, options) {
|
@@ -5599,8 +5610,10 @@ are based on this module.
|
|
5599
5610
|
|
5600
5611
|
@function up.destroy
|
5601
5612
|
@param {String|Element|jQuery} selectorOrElement
|
5602
|
-
@param {String} [options.
|
5613
|
+
@param {String} [options.history]
|
5614
|
+
A URL that will be pushed as a new history entry when the element begins destruction.
|
5603
5615
|
@param {String} [options.title]
|
5616
|
+
The document title to set when the element begins destruction.
|
5604
5617
|
@param {String|Function} [options.animation='none']
|
5605
5618
|
The animation to use before the element is removed from the DOM.
|
5606
5619
|
@param {Number} [options.duration]
|
@@ -5631,12 +5644,7 @@ are based on this module.
|
|
5631
5644
|
});
|
5632
5645
|
animateOptions = up.motion.animateOptions(options);
|
5633
5646
|
$element.addClass('up-destroying');
|
5634
|
-
|
5635
|
-
up.history.push(options.url);
|
5636
|
-
}
|
5637
|
-
if (u.isPresent(options.title)) {
|
5638
|
-
document.title = options.title;
|
5639
|
-
}
|
5647
|
+
updateHistory(options);
|
5640
5648
|
animationDeferred = u.presence(options.animation, u.isDeferred) || up.motion.animate($element, options.animation, animateOptions);
|
5641
5649
|
animationDeferred.then(function() {
|
5642
5650
|
up.syntax.clean($element);
|
@@ -8809,8 +8817,10 @@ To disable this behavior, give the opening link an `up-sticky` attribute:
|
|
8809
8817
|
state.phase = 'opening';
|
8810
8818
|
state.$anchor = $anchor;
|
8811
8819
|
state.position = position;
|
8812
|
-
|
8813
|
-
|
8820
|
+
if (options.history) {
|
8821
|
+
state.coveredUrl = up.browser.url();
|
8822
|
+
state.coveredTitle = document.title;
|
8823
|
+
}
|
8814
8824
|
state.sticky = options.sticky;
|
8815
8825
|
options.beforeSwap = function() {
|
8816
8826
|
return createFrame(target);
|
@@ -8884,7 +8894,7 @@ To disable this behavior, give the opening link an `up-sticky` attribute:
|
|
8884
8894
|
}
|
8885
8895
|
options = u.options(options, {
|
8886
8896
|
animation: config.closeAnimation,
|
8887
|
-
|
8897
|
+
history: state.coveredUrl,
|
8888
8898
|
title: state.coveredTitle
|
8889
8899
|
});
|
8890
8900
|
animateOptions = up.motion.animateOptions(options, {
|
@@ -9467,8 +9477,10 @@ To disable this behavior, give the opening link an `up-sticky` attribute:
|
|
9467
9477
|
state.phase = 'opening';
|
9468
9478
|
state.flavor = options.flavor;
|
9469
9479
|
state.sticky = options.sticky;
|
9470
|
-
|
9471
|
-
|
9480
|
+
if (options.history) {
|
9481
|
+
state.coveredUrl = up.browser.url();
|
9482
|
+
state.coveredTitle = document.title;
|
9483
|
+
}
|
9472
9484
|
options.beforeSwap = function() {
|
9473
9485
|
return createFrame(target, options);
|
9474
9486
|
};
|
@@ -9547,7 +9559,7 @@ To disable this behavior, give the opening link an `up-sticky` attribute:
|
|
9547
9559
|
easing: flavorDefault('closeEasing')
|
9548
9560
|
});
|
9549
9561
|
destroyOptions = u.options(u.except(options, 'animation', 'duration', 'easing', 'delay'), {
|
9550
|
-
|
9562
|
+
history: state.coveredUrl,
|
9551
9563
|
title: state.coveredTitle
|
9552
9564
|
});
|
9553
9565
|
return up.bus.whenEmitted('up:modal:close', {
|
data/dist/unpoly.min.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
(function(){window.up={version:"0.27.2"}}).call(this),function(){var e=[].slice,t=function(e,t){return function(){return e.apply(t,arguments)}};up.util=function(n){var r,o,i,u,a,s,l,c,p,f,d,m,h,v,g,y,b,w,k,S,A,x,$,D,T,E,C,P,O,F,U,R,_,M,N,j,I,K,L,q,z,W,H,Q,V,J,B,X,G,Y,Z,ee,te,ne,re,oe,ie,ue,ae,se,le,ce,pe,fe,de,me,he,ve,ge,ye,be,we,ke,Se,Ae,xe,$e,De,Te,Ee,Ce,Pe,Oe,Fe,Ue,Re,_e,Me,Ne,je,Ie,Ke,Le,qe,ze,We,He,Qe,Ve,Je,Be,Xe,Ge,Ye,Ze,et,tt,nt;return ge=n.noop,pe=function(t){var n,r;return n=void 0,r=!1,function(){var o;return o=1<=arguments.length?e.call(arguments,0):[],r?n:(r=!0,n=t.apply(null,o))}},ne=function(e,t){return t=t.toString(),(""===t||"80"===t)&&"http:"===e||"443"===t&&"https:"===e},be=function(e,t){var n,r,o;return n=Te(e),r=n.protocol+"//"+n.hostname,ne(n.protocol,n.port)||(r+=":"+n.port),o=n.pathname,"/"!==o[0]&&(o="/"+o),(null!=t?t.stripTrailingSlash:void 0)!==!1&&(o=o.replace(/\/$/,"")),r+=o,(null!=t?t.hash:void 0)===!0&&(r+=n.hash),(null!=t?t.search:void 0)!==!1&&(r+=n.search),r},Te=function(e){var t;return t=null,re(e)?(t=n("<a>").attr({href:e}).get(0),I(t.hostname)&&(t.href=t.href)):t=Ge(e),t},ye=function(e){return e?e.toUpperCase():"GET"},r=function(e){var t,r,o,i,u,a,s,l,c,p,f,d,m,h,v,g;for(v=e.split(/[ >]/),o=null,f=c=0,m=v.length;m>c;f=++c){for(a=v[f],u=a.match(/(^|\.|\#)[A-Za-z0-9\-_]+/g),g="div",i=[],p=null,d=0,h=u.length;h>d;d++)switch(s=u[d],s[0]){case".":i.push(s.substr(1));break;case"#":p=s.substr(1);break;default:g=s}l="<"+g,i.length&&(l+=' class="'+i.join(" ")+'"'),p&&(l+=' id="'+p+'"'),l+=">",t=n(l),r&&t.appendTo(r),0===f&&(o=t),r=t}return o},b=function(e,t){var n;return n=document.createElement(e),ee(t)&&(n.innerHTML=t),n},o=function(e,t){var n;return null==t&&(t=document.body),n=r(e),n.addClass("up-placeholder"),n.appendTo(t),n},ze=function(e){var t,r,o,i,u,a,s,l,c;if(t=n(e),l=void 0,up.puts("Creating selector from element %o",t.get(0)),c=Pe(t.attr("up-id")))l="[up-id='"+c+"']";else if(i=Pe(t.attr("id")))l="#"+i;else if(s=Pe(t.attr("name")))l="[name='"+s+"']";else if(r=Pe(ve(t)))for(l="",o=0,a=r.length;a>o;o++)u=r[o],l+="."+u;else l=t.prop("tagName").toLowerCase();return l},ve=function(e){var t,n;return t=e.attr("class")||"",n=t.split(" "),qe(n,function(e){return ee(e)&&!e.match(/^up-/)})},w=function(e){var t,n,r,o,i,u,a,s,l,c,p,f;return l=function(e){return"<"+e+"(?: [^>]*)?>"},u=function(e){return"</"+e+">"},t="(?:.|\\s)*?",i=function(e){return"("+e+")"},f=new RegExp(l("head")+t+l("title")+i(t)+u("title")+t+u("body"),"i"),o=new RegExp(l("body")+i(t)+u("body"),"i"),(r=e.match(o))?(s=document.createElement("html"),n=b("body",r[1]),s.appendChild(n),(p=e.match(f))&&(a=b("head"),s.appendChild(a),c=b("title",p[1]),a.appendChild(c)),s):b("div",e)},C=n.extend,Xe=n.trim,x=function(e,t){var n,r,o,i,u;for(u=[],r=n=0,i=e.length;i>n;r=++n)o=e[r],u.push(t(o,r));return u},le=x,Ve=function(e,t){var n,r,o,i;for(i=[],r=n=0,o=e-1;o>=0?o>=n:n>=o;r=o>=0?++n:--n)i.push(t(r));return i},G=function(e){return null===e},oe=function(e){return void 0===e},L=function(e){return!oe(e)},X=function(e){return oe(e)||G(e)},V=function(e){return!X(e)},I=function(e){return X(e)||Z(e)&&0===Object.keys(e).length||0===e.length},Pe=function(e,t){return null==t&&(t=ee),t(e)?e:void 0},ee=function(e){return!I(e)},Q=function(e){return"function"==typeof e},re=function(e){return"string"==typeof e},Y=function(e){return"number"==typeof e},J=function(e){return"object"==typeof e&&!!e},Z=function(e){return J(e)||"function"==typeof e},z=function(e){return!(!e||1!==e.nodeType)},B=function(e){return e instanceof jQuery},te=function(e){return Z(e)&&Q(e.then)},K=function(e){return te(e)&&Q(e.resolve)},j=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},H=function(e){return up.browser.canFormData()&&e instanceof FormData},Be=function(e){return Array.prototype.slice.call(e)},g=function(e){return j(e)?e.slice():J(e)?C({},e):void 0},Ge=function(e){return B(e)?e.get(0):e},fe=function(){var t;return t=1<=arguments.length?e.call(arguments,0):[],C.apply(null,[{}].concat(e.call(t)))},De=function(e,t){var n,r,o,i;if(o=e?g(e):{},t)for(r in t)n=t[r],i=o[r],V(i)?Z(n)&&Z(i)&&(o[r]=De(i,n)):o[r]=n;return o},$e=function(){var t;return t=1<=arguments.length?e.call(arguments,0):[],S(t,V)},S=function(e,t){var n,r,o,i;for(i=void 0,r=0,o=e.length;o>r;r++)if(n=e[r],t(n)){i=n;break}return i},l=function(e,t){var n,r,o,i;for(i=!1,r=0,o=e.length;o>r;r++)if(n=e[r],t(n)){i=!0;break}return i},s=function(e,t){var n,r,o,i;for(i=!0,r=0,o=e.length;o>r;r++)if(n=e[r],!t(n)){i=!1;break}return i},m=function(e){return qe(e,V)},Ye=function(e){var t;return t={},qe(e,function(e){return t.hasOwnProperty(e)?!1:t[e]=!0})},qe=function(e,t){var n;return n=[],x(e,function(e){return t(e)?n.push(e):void 0}),n},Ue=function(e,t){return qe(e,function(e){return!t(e)})},N=function(e,t){return qe(e,function(e){return v(t,e)})},Oe=function(){var t,n,r,o;return t=arguments[0],r=2<=arguments.length?e.call(arguments,1):[],o=function(){var e,o,i;for(i=[],e=0,o=r.length;o>e;e++)n=r[e],i.push(t.attr(n));return i}(),S(o,ee)},He=function(e,t){return e>0?setTimeout(t,e):t()},he=function(e){return setTimeout(e,0)},ae=function(e){return e[e.length-1]},d=function(){var e;return e=document.documentElement,{width:e.clientWidth,height:e.clientHeight}},Le=pe(function(){var e,t,r;return e=n("<div>"),e.attr("up-viewport",""),e.css({position:"absolute",top:"0",left:"0",width:"50px",height:"50px",overflowY:"scroll"}),e.appendTo(document.body),t=e.get(0),r=t.offsetWidth-t.clientWidth,e.remove(),r}),A=function(){var e,t,r,o,i,u;return t=document.body,e=n(t),u=document.documentElement,r=e.css("overflow-y"),i="scroll"===r,o="hidden"===r,i||!o&&u.scrollHeight>u.clientHeight},Se=function(t){var n;return n=void 0,function(){var r;return r=1<=arguments.length?e.call(arguments,0):[],null!=t&&(n=t.apply(null,r)),t=void 0,n}},Qe=function(e,t,r){var o,i,u;return o=n(e),u=o.css(Object.keys(t)),o.css(t),i=function(){return o.css(u)},r?(r(),i()):Se(i)},R=function(e){var t,n;return n=e.css(["transform","-webkit-transform"]),I(n)||"none"===n.transform?(t=function(){return e.css(n)},e.css({transform:"translateZ(0)","-webkit-transform":"translateZ(0)"})):t=function(){},t},_=function(e){return e=Ge(e),e.offsetHeight},k=function(e,t,r){var o,u,a,s,l,c,p,f;return o=n(e),r=De(r,{duration:300,delay:0,easing:"ease"}),0===r.duration?(o.css(t),Ie()):(u=n.Deferred(),p=Object.keys(t),l={"transition-property":p.join(", "),"transition-duration":r.duration+"ms","transition-delay":r.delay+"ms","transition-timing-function":r.easing},a=o.css(Object.keys(l)),o.addClass("up-animating"),c=function(){return o.removeClass("up-animating"),o.off("transitionend",s)},s=function(e){var t;return t=e.originalEvent.propertyName,v(p,t)?(u.resolve(),c()):void 0},o.on("transitionend",s),u.then(c),f=R(o),o.css(l),o.css(t),o.data(i,u),u.then(function(){var e;return o.removeData(i),f(),o.css({transition:"none"}),e=!("none"===a["transition-property"]||"all"===a["transition-property"]&&"0"===a["transition-duration"][0]),e?(_(o),o.css(a)):void 0}),u)},i="up-animation-deferred",F=function(e){return n(e).each(function(){var e;return(e=Ee(this,i))?e.resolve():void 0})},ce=function(e,t){var r,o,i,u,a;return t=De(t,{relative:!1,inner:!1}),t.relative?t.relative===!0?u=e.position():(r=n(t.relative),a=e.offset(),r.is(document)?u=a:(i=r.offset(),u={left:a.left-i.left,top:a.top-i.top})):u=e.offset(),o={left:u.left,top:u.top},t.inner?(o.width=e.width(),o.height=e.height()):(o.width=e.outerWidth(),o.height=e.outerHeight()),o},y=function(e,t){var n,r,o,i,u;for(i=e.get(0).attributes,u=[],r=0,o=i.length;o>r;r++)n=i[r],n.specified?u.push(t.attr(n.name,n.value)):u.push(void 0);return u},O=function(e,t){return e.find(t).addBack(t)},T=function(e){return 27===e.keyCode},v=function(e,t){return e.indexOf(t)>=0},f=function(e,t){var n;switch(n=e.attr(t)){case"false":return!1;case"true":return!0;case"":return!0;default:return n}},se=function(e){return e.getResponseHeader("X-Up-Location")},Je=function(e){return e.getResponseHeader("X-Up-Title")},de=function(e){return e.getResponseHeader("X-Up-Method")},Ae=function(){var t,n,r,o,i,u;for(o=arguments[0],i=2<=arguments.length?e.call(arguments,1):[],t={},n=0,r=i.length;r>n;n++)u=i[n],o.hasOwnProperty(u)&&(t[u]=o[u]);return t},E=function(){var t,n,r,o,i,u;for(o=arguments[0],i=2<=arguments.length?e.call(arguments,1):[],t=g(o),n=0,r=i.length;r>n;n++)u=i[n],delete t[u];return t},ie=function(e){return!(e.metaKey||e.shiftKey||e.ctrlKey)},ue=function(e){var t;return t=oe(e.button)||0===e.button,t&&ie(e)},Ie=function(){var e;return e=n.Deferred(),e.resolve(),e},Ke=function(){return Ie().promise()},Ze=function(){return n.Deferred()},et=function(){return Ze().promise()},we=function(){return n()},je=function(){var t,r;return t=1<=arguments.length?e.call(arguments,0):[],r=n.when.apply(n,[Ie()].concat(e.call(t))),r.resolve=pe(function(){return x(t,function(e){return e.resolve()})}),r},We=function(e,t){var n,r,o;r=[];for(n in t)o=t[n],X(e.attr(n))?r.push(e.attr(n,o)):r.push(void 0);return r},Re=function(e,t){var n;return n=e.indexOf(t),n>=0?(e.splice(n,1),t):void 0},me=function(e){var t,r,o,i,u,a,s;for(u={},s=[],r=[],o=0,i=e.length;i>o;o++)a=e[o],re(a)?s.push(a):r.push(a);return u.parsed=r,s.length&&(t=s.join(", "),u.parsed.push(t)),u.select=function(){return u.find(void 0)},u.find=function(e){var t,r,o,i,a,s;for(r=we(),a=u.parsed,o=0,i=a.length;i>o;o++)s=a[o],t=e?e.find(s):n(s),r=r.add(t);return r},u.findWithSelf=function(e){var t;return t=u.find(e),u.doesMatch(e)&&(t=t.add(e)),t},u.doesMatch=function(e){var t;return t=n(e),l(u.parsed,function(e){return t.is(e)})},u.seekUp=function(e){var t,r,o;for(o=n(e),t=o,r=void 0;t.length;){if(u.doesMatch(t)){r=t;break}t=t.parent()}return r||we()},u},p=function(t){var n,r,o,i,u,a,s,l,c,p,f,d,m,h,v;return null==t&&(t={}),h=void 0,d=function(e){return function(){var n;return n=t[e],Y(n)?n:Q(n)?n():void 0}},p=d("size"),o=d("expiry"),f=function(e){return t.key?t.key(e):e.toString()},u=function(){return 0!==p()&&0!==o()},r=function(){return h={}},r(),l=function(){var n;return n=1<=arguments.length?e.call(arguments,0):[],t.logPrefix?(n[0]="["+t.logPrefix+"] "+n[0],up.puts.apply(up,n)):void 0},s=function(){return Object.keys(h)},c=function(){var e,t,n,r;return r=g(s()),e=p(),e&&r.length>=e&&(t=null,n=null,x(r,function(e){var r,o;return r=h[e],o=r.timestamp,!n||n>o?(t=e,n=o):void 0}),t)?delete h[t]:void 0},n=function(e,t){var n;return n=i(e,{silent:!0}),L(n)?m(t,n):void 0},v=function(){return(new Date).valueOf()},m=function(e,t){var n;return u()?(c(),n=f(e),h[n]={timestamp:v(),value:t}):void 0},Re=function(e){var t;return t=f(e),delete h[t]},a=function(e){var t,n;return t=o(),t?(n=v()-e.timestamp,t>n):!0},i=function(e,t){var n,r;return null==t&&(t={}),r=f(e),(n=h[r])?a(n)?(t.silent||l("Cache hit for '%s'",e),n.value):(t.silent||l("Discarding stale cache entry for '%s'",e),void Re(e)):void(t.silent||l("Cache miss for '%s'",e))},{alias:n,get:i,set:m,remove:Re,clear:r,keys:s}},h=function(e){var t;return null==e&&(e={}),t={},t.reset=function(){var n;return n=e,Q(n)&&(n=n()),C(t,n)},t.reset(),Object.preventExtensions(t),t},tt=function(e){var t,n;return e=Ge(e),t=e.parentNode,n=Be(e.childNodes),x(n,function(n){return t.insertBefore(n,e)}),t.removeChild(e)},ke=function(e){var t,n;for(t=void 0;(e=e.parent())&&e.length;)if(n=e.css("position"),"absolute"===n||"relative"===n||e.is("body")){t=e;break}return t},W=function(e){var t,r;for(t=n(e);;){if(r=t.css("position"),"fixed"===r)return!0;if(t=t.parent(),0===t.length||t.is(document))return!1}},U=function(e,t){var r,o,i,u;return r=n(e),o=ke(r),i=r.position(),u=o.offset(),r.css({position:"absolute",left:i.left-u.left,top:i.top-u.top+t.scrollTop(),right:"",bottom:""})},_e=function(e){var t,n,r,o,i,u,a;if(H(e))return up.error("Cannot convert FormData into an array");for(u=Me(e),t=[],a=u.split("&"),n=0,r=a.length;r>n;n++)i=a[n],ee(i)&&(o=i.split("="),t.push({name:decodeURIComponent(o[0]),value:decodeURIComponent(o[1])}));return t},Me=function(e){var t;return H(e)?up.error("Cannot convert FormData into a query string"):ee(e)?(t=n.param(e),t=t.replace(/\+/g,"%20")):""},Ne=function(e){var t,r;return t=n(e),r=t.find("input[type=file]").length,r&&up.browser.canFormData()?new FormData(t.get(0)):t.serializeArray()},c=function(e,t,n){var r;return H(e)?e.append(t,n):j(e)?e.push({name:t,value:n}):Z(e)?e[t]=n:(re(e)||X(e))&&(r=Me([{name:t,value:n}]),e=ee(e)?[e,r].join("&"):r),e},$=function(){var t,r,o,i;throw t=1<=arguments.length?e.call(arguments,0):[],(o=up.log).error.apply(o,t),nt().then(function(){var r,o,i,u;return r=Pe(n(".up-error"))||n('<div class="up-error"></div>').prependTo("body"),i=function(e){return"<span class='up-error-variable'>"+D(e)+"</span>"},o=(u=up.browser).sprintfWithFormattedArgs.apply(u,[i].concat(e.call(t))),r.html(o)}),r=(i=up.browser).sprintf.apply(i,t),new Error(r)},a={"&":"&","<":"<",">":">",'"':"""},D=function(e){return e.replace(/[&<>"]/g,function(e){return a[e]})},Ce=function(e,t){var n;return n=e[t],delete e[t],n},Ee=function(e,t){var r,o;return r=n(e),o=r.data(t),r.removeData(t),o},P=function(e){var t;return t=ae(e),J(t)&&!B(t)?e.pop():{}},xe=function(e){var t;return t=n(e).css("opacity"),V(t)?parseFloat(t):void 0},nt=pe(function(){var e;return n.isReady?Ke():(e=n.Deferred(),n(function(){return e.resolve()}),e.promise())}),M=function(e){return e},q=function(e){return e=Ge(e),!jQuery.contains(document.documentElement,e)},Fe=function(t){var r,o;return r=n.Deferred(),o=function(){var n;return n=1<=arguments.length?e.call(arguments,0):[],t.apply(null,n).then(function(){return r.resolve()})},o.promise=r.promise(),o},u=function(){function r(){this.asap=t(this.asap,this),this.poke=t(this.poke,this),this.allTasks=t(this.allTasks,this),this.promise=t(this.promise,this),this.reset=t(this.reset,this),this.reset()}return r.prototype.reset=function(){return this.queue=[],this.currentTask=void 0},r.prototype.promise=function(){var e;return e=le(this.allTasks(),function(e){return e.promise}),n.when.apply(n,e)},r.prototype.allTasks=function(){var e;return e=[],this.currentTask&&e.push(this.currentTask),e=e.concat(this.queue)},r.prototype.poke=function(){var e;return!this.currentTask&&(this.currentTask=this.queue.shift())?(e=this.currentTask(),e.always(function(e){return function(){return e.currentTask=void 0,e.poke()}}(this))):void 0},r.prototype.asap=function(){var t;return t=1<=arguments.length?e.call(arguments,0):[],this.queue=le(t,Fe),this.poke()},r}(),{isDetached:q,requestDataAsArray:_e,requestDataAsQuery:Me,appendRequestData:c,requestDataFromForm:Ne,offsetParent:ke,fixedToAbsolute:U,isFixed:W,presentAttr:Oe,createElement:b,parseUrl:Te,normalizeUrl:be,normalizeMethod:ye,createElementFromHtml:w,$createElementFromSelector:r,$createPlaceholder:o,selectorForElement:ze,extend:C,copy:g,merge:fe,options:De,option:$e,error:$,each:x,map:le,times:Ve,any:l,all:s,detect:S,select:qe,reject:Ue,intersect:N,compact:m,uniq:Ye,last:ae,isNull:G,isDefined:L,isUndefined:oe,isGiven:V,isMissing:X,isPresent:ee,isBlank:I,presence:Pe,isObject:Z,isFunction:Q,isString:re,isNumber:Y,isElement:z,isJQuery:B,isPromise:te,isDeferred:K,isHash:J,isArray:j,isFormData:H,isUnmodifiedKeyEvent:ie,isUnmodifiedMouseEvent:ue,nullJQuery:we,unJQuery:Ge,setTimer:He,nextFrame:he,measure:ce,temporaryCss:Qe,cssAnimate:k,finishCssAnimate:F,forceCompositing:R,forceRepaint:_,escapePressed:T,copyAttributes:y,findWithSelf:O,contains:v,toArray:Be,castedAttr:f,locationFromXhr:se,titleFromXhr:Je,methodFromXhr:de,clientSize:d,only:Ae,except:E,trim:Xe,unresolvableDeferred:Ze,unresolvablePromise:et,resolvedPromise:Ke,resolvedDeferred:Ie,resolvableWhen:je,setMissingAttrs:We,remove:Re,memoize:pe,scrollbarWidth:Le,documentHasVerticalScrollbar:A,config:h,cache:p,unwrapElement:tt,multiSelector:me,error:$,pluckData:Ee,pluckKey:Ce,extractOptions:P,isDetached:q,noop:ge,opacity:xe,whenReady:nt,identity:M,escapeHtml:D,DivertibleChain:u}}($),up.error=up.util.error}.call(this),function(){var e=[].slice;up.browser=function(t){var n,r,o,i,u,a,s,l,c,p,f,d,m,h,v,g,y,b,w,k,S,A;return k=up.util,m=function(e,n){var r,o,i,u,a;return null==n&&(n={}),u=k.option(n.method,"get").toLowerCase(),"get"===u?(a=k.requestDataAsQuery(n.data),a&&(e=e+"?"+a),location.href=e):(r=t("<form method='post' action='"+e+"'></form>"),o=function(e){var n;return n=t('<input type="hidden">'),n.attr(e.name,e.value),n.appendTo(r)},o({name:up.proxy.config.wrapMethodParam,value:u}),(i=up.rails.csrfField())&&o(i),k.each(k.requestDataAsArray(n.data),o),r.hide().appendTo("body"),r.submit())},v=function(){var t,n,r;return r=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],u()?console[r].apply(console,t):(n=y.apply(null,t),console[r](n))},n=/\%[odisf]/g,w=function(e){var n,r,o,i,u,a,s,l,c;if(a=100,o="",k.isString(e))l=e.replace(/[\n\r\t ]+/g," "),l=l.replace(/^[\n\r\t ]+/,""),l=l.replace(/[\n\r\t ]$/,""),l='"'+l+'"',o='"';else if(k.isUndefined(e))l="undefined";else if(k.isNumber(e)||k.isFunction(e))l=e.toString();else if(k.isArray(e))l="["+k.map(e,w).join(", ")+"]",o="]";else if(k.isJQuery(e))l="$("+k.map(e,w).join(", ")+")",o=")";else if(k.isElement(e)){for(n=t(e),l="<"+e.tagName.toLowerCase(),s=["id","name","class"],i=0,u=s.length;u>i;i++)r=s[i],(c=n.attr(r))&&(l+=" "+r+'="'+c+'"');l+=">",o=">"}else l=JSON.stringify(e);return l.length>a&&(l=l.substr(0,a)+" \u2026",l+=o),l},y=function(){var t,n;return n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],b.apply(null,[k.identity,n].concat(e.call(t)))},b=function(){var t,r,o,i;return r=arguments[0],i=arguments[1],t=3<=arguments.length?e.call(arguments,2):[],k.isBlank(i)?"":(o=0,i.replace(n,function(){var e;return e=t[o],e=r(w(e)),o+=1,e}))},S=function(){return location.href},c=k.memoize(function(){return k.isUndefined(document.addEventListener)}),p=k.memoize(function(){return c()||-1!==navigator.appVersion.indexOf("MSIE 9.")}),a=k.memoize(function(){return k.isDefined(history.pushState)&&"get"===s()}),r=k.memoize(function(){return"transition"in document.documentElement.style}),i=k.memoize(function(){return"oninput"in document.createElement("input")}),o=k.memoize(function(){return!!window.FormData}),u=k.memoize(function(){return!p()}),f=k.memoize(function(){var e,n,r,o;return o=t.fn.jquery,r=o.split("."),e=parseInt(r[0]),n=parseInt(r[1]),e>=2||1===e&&n>=9}),h=function(e){var t,n;return n=null!=(t=document.cookie.match(new RegExp(e+"=(\\w+)")))?t[1]:void 0,k.isPresent(n)&&(document.cookie=e+"=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/"),n},A=function(e){return e.preload||k.isBlank(e.confirm)||window.confirm(e.confirm)?k.resolvedPromise():k.unresolvablePromise()},s=k.memoize(function(){return(h("_up_request_method")||"get").toLowerCase()}),d=function(){return!c()&&f()},l=function(){var t,n,r,o;for(null==window.console&&(window.console={}),o=["debug","info","warn","error","group","groupCollapsed","groupEnd"],t=0,n=o.length;n>t;t++)r=o[t],null==console[r]&&(console[r]=function(){var t;return t=1<=arguments.length?e.call(arguments,0):[],v.apply(null,["log"].concat(e.call(t)))});return null!=console.log?console.log:console.log=k.noop},g=k.memoize(function(){return window.sessionStorage||{getItem:k.noop,setItem:k.noop,removeItem:k.noop}}),{url:S,loadPage:m,whenConfirmed:A,canPushState:a,canCssTransition:r,canInputEvent:i,canFormData:o,canLogSubstitution:u,isSupported:d,installPolyfills:l,puts:v,sprintf:y,sprintfWithFormattedArgs:b,sessionStorage:g}}(jQuery)}.call(this),function(){var slice=[].slice;up.bus=function($){var boot,emit,emitReset,forgetUpDescription,live,liveUpDescriptions,logEmission,nextUpDescriptionNumber,nobodyPrevents,onEscape,rememberUpDescription,restoreSnapshot,snapshot,u,unbind,upDescriptionNumber,upDescriptionToJqueryDescription,upListenerToJqueryListener,whenEmitted;return u=up.util,liveUpDescriptions={},nextUpDescriptionNumber=0,upListenerToJqueryListener=function(e){return function(t){var n;return n=t.$element||$(this),e.apply(n.get(0),[t,n,up.syntax.data(n)])}},upDescriptionToJqueryDescription=function(e,t){var n,r,o;return n=u.copy(e),o=n.pop(),r=void 0,t?(r=upListenerToJqueryListener(o),o._asJqueryListener=r,o._descriptionNumber=++nextUpDescriptionNumber):(r=o._asJqueryListener,r||u.error("up.off: The event listener %o was never registered through up.on")),n.push(r),n},live=function(){var e,t,n;return n=1<=arguments.length?slice.call(arguments,0):[],up.browser.isSupported()?(e=upDescriptionToJqueryDescription(n,!0),rememberUpDescription(n),(t=$(document)).on.apply(t,e),function(){return unbind.apply(null,n)}):function(){}},unbind=function(){var e,t,n;return n=1<=arguments.length?slice.call(arguments,0):[],e=upDescriptionToJqueryDescription(n,!1),forgetUpDescription(n),(t=$(document)).off.apply(t,e)},rememberUpDescription=function(e){var t;return t=upDescriptionNumber(e),liveUpDescriptions[t]=e},forgetUpDescription=function(e){var t;return t=upDescriptionNumber(e),delete liveUpDescriptions[t]},upDescriptionNumber=function(e){return u.last(e)._descriptionNumber},emit=function(e,t){var n,r;return null==t&&(t={}),r=$.Event(e,t),(n=t.$element)?delete t.$element:n=$(document),logEmission(e,t),n.trigger(r),r},logEmission=function(e,t){var n,r,o;return t.hasOwnProperty("message")?(n=t.message,delete t.message,u.isArray(n)?(o=n,n=o[0],r=2<=o.length?slice.call(o,1):[]):r=[],n?u.isPresent(t)?up.puts.apply(up,[n+" (%s (%o))"].concat(slice.call(r),[e],[t])):up.puts.apply(up,[n+" (%s)"].concat(slice.call(r),[e])):void 0):u.isPresent(t)?up.puts("Emitted event %s (%o)",e,t):up.puts("Emitted event %s",e)},nobodyPrevents=function(){var e,t;return e=1<=arguments.length?slice.call(arguments,0):[],t=emit.apply(null,e),t.isDefaultPrevented()?(up.puts("An observer prevented the event %s",e[0]),!1):!0},whenEmitted=function(){var e,t;return e=1<=arguments.length?slice.call(arguments,0):[],t=$.Deferred(),nobodyPrevents.apply(null,e)&&t.resolve(),t.promise()},onEscape=function(e){return live("keydown","body",function(t){return u.escapePressed(t)?e(t):void 0})},snapshot=function(){var e,t,n,r;for(r=[],t=0,n=liveUpDescriptions.length;n>t;t++)e=liveUpDescriptions[t],r.push(e.isDefault=!0);return r},restoreSnapshot=function(){var e,t,n,r,o;for(t=u.reject(liveUpDescriptions,function(e){return e.isDefault}),o=[],n=0,r=t.length;r>n;n++)e=t[n],o.push(unbind.apply(null,e));return o},emitReset=function(){return emit("up:framework:reset",{message:"Resetting framework"})},boot=function(){return up.browser.isSupported()?(up.browser.installPolyfills(),emit("up:framework:boot",{message:"Booting framework"}),emit("up:framework:booted",{message:"Framework booted"}),u.nextFrame(function(){return u.whenReady().then(function(){return emit("up:app:boot",{message:"Booting user application"}),emit("up:app:booted",{message:"User application booted"})})})):void 0},live("up:framework:booted",snapshot),live("up:framework:reset",restoreSnapshot),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),on:live,off:unbind,emit:emit,nobodyPrevents:nobodyPrevents,whenEmitted:whenEmitted,onEscape:onEscape,emitReset:emitReset,boot:boot}}(jQuery),up.on=up.bus.on,up.off=up.bus.off,up.emit=up.bus.emit,up.reset=up.bus.emitReset,up.boot=up.bus.boot}.call(this),function(){var e=[].slice;up.log=function(t){var n,r,o,i,u,a,s,l,c,p,f,d,m,h,v;return h=up.util,r=up.browser,n="up.log.enabled",o=h.config({prefix:"[UP] ",enabled:h.option(r.sessionStorage().getItem(n),!1),collapse:!1}),d=function(){return o.reset()},c=function(e){return""+o.prefix+e},i=function(){var t,n;return n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],o.enabled&&n?r.puts.apply(r,["debug",c(n)].concat(e.call(t))):void 0},f=function(){var t,n;return n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],o.enabled&&n?r.puts.apply(r,["log",c(n)].concat(e.call(t))):void 0},v=function(){var t,n;return n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],o.enabled&&n?r.puts.apply(r,["warn",c(n)].concat(e.call(t))):void 0},l=function(){var t,n,i,u;if(i=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],n=t.pop(),!o.enabled||!i)return n();u=o.collapse?"groupCollapsed":"group",r.puts.apply(r,[u,c(i)].concat(e.call(t)));try{return n()}finally{i&&r.puts("groupEnd")}},s=function(){var t,n;return n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],n?r.puts.apply(r,["error",c(n)].concat(e.call(t))):void 0},p=function(){var e;return e=" __ _____ ___ ___ / /_ __\n"+("/ // / _ \\/ _ \\/ _ \\/ / // / "+up.version+"\n")+"\\___/_//_/ .__/\\___/_/\\_. / \n / / / /\n\n",e+=o.enabled?"Call `up.log.disable()` to disable logging for this session.":"Call `up.log.enable()` to enable logging for this session.",r.puts("log",e)},up.on("up:framework:boot",p),up.on("up:framework:reset",d),m=function(e){return r.sessionStorage().setItem(n,e),o.enabled=e},a=function(){return m(!0)},u=function(){return m(!1)},{puts:f,debug:i,error:s,warn:v,group:l,config:o,enable:a,disable:u}}(jQuery),up.puts=up.log.puts}.call(this),function(){var e=[].slice;up.syntax=function(t){var n,r,o,i,u,a,s,l,c,p,f,d,m,h,v,g;return g=up.util,n="up-destructable",r="up-destructors",c=[],m=[],l=function(){var t;return t=1<=arguments.length?e.call(arguments,0):[],f.apply(null,[c].concat(e.call(t)))},d=function(){var t;return t=1<=arguments.length?e.call(arguments,0):[],f.apply(null,[m].concat(e.call(t)))},u=function(){var t,n,r,o;return o=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],n=t.pop(),r=g.options(t[0],{priority:0}),"first"===r.priority?r.priority=Number.POSITIVE_INFINITY:"last"===r.priority&&(r.priority=Number.NEGATIVE_INFINITY),{selector:o,callback:n,priority:r.priority,batch:r.batch,keep:r.keep}},f=function(){var t,n,r,o,i;if(i=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],up.browser.isSupported()){for(r=u.apply(null,t),n=0;(o=i[n])&&o.priority>=r.priority;)n+=1;return i.splice(n,0,r)}},i=function(e,t,n){var r,i;return up.puts(e.isDefault?void 0:"Compiling '%s' on %o",e.selector,n),e.keep&&(i=g.isString(e.keep)?e.keep:"",t.attr("up-keep",i)),r=e.callback.apply(n,[t,p(t)]),g.isFunction(r)?o(t,r):void 0},o=function(e,t){var o;return e.addClass(n),o=e.data(r)||[],o.push(t),e.data(r,o)},s=function(e,n){var r;return n=g.options(n),r=t(n.skip),up.log.group("Compiling fragment %o",e.get(0),function(){var n,o,u,a,s,p;for(s=[m,c],p=[],o=0,u=s.length;u>o;o++)a=s[o],p.push(function(){var o,u,s;for(s=[],o=0,u=a.length;u>o;o++)l=a[o],n=g.findWithSelf(e,l.selector),n=n.filter(function(){var e;return e=t(this),g.all(r,function(t){return 0===e.closest(t).length})}),n.length?s.push(up.log.group(l.isDefault?void 0:"Compiling '%s' on %d element(s)",l.selector,n.length,function(){return l.batch?i(l,n,n.get()):n.each(function(){return i(l,t(this),this)})})):s.push(void 0);return s}());return p})},a=function(e){return g.findWithSelf(e,"."+n).each(function(){var e,o,i,u,a;for(e=t(this),i=e.data(r),u=0,a=i.length;a>u;u++)(o=i[u])();return e.removeData(r),e.removeClass(n)})},p=function(e){var n,r;return n=t(e),r=n.attr("up-data"),g.isString(r)&&""!==g.trim(r)?JSON.parse(r):{}},v=function(){var e;return e=function(e){return e.isDefault=!0},g.each(c,e),g.each(m,e)},h=function(){var e;return e=function(e){return e.isDefault},c=g.select(c,e),m=g.select(m,e)},up.on("up:framework:booted",v),up.on("up:framework:reset",h),{compiler:l,macro:d,compile:s,clean:a,data:p}}(jQuery),up.compiler=up.syntax.compiler,up.macro=up.syntax.macro,up.ready=function(){return up.util.error("up.ready no longer exists. Please use up.hello instead.")},up.awaken=function(){return up.util.error("up.awaken no longer exists. Please use up.compiler instead.")}}.call(this),function(){up.history=function(e){var t,n,r,o,i,u,a,s,l,c,p,f,d,m,h,v;return v=up.util,n=v.config({popTargets:["body"],restoreScroll:!0}),c=void 0,u=void 0,m=function(){return n.reset(),c=void 0,u=void 0},a=function(e){return v.normalizeUrl(e,{hash:!0})},r=function(){return a(up.browser.url())},o=function(e){return a(e)===r()},s=function(e){return u&&(c=u,u=void 0),u=e},d=function(e){return i("replaceState",e)},p=function(e,t){return t=v.options(t,{force:!1}),e=a(e),!t.force&&o(e)||!up.bus.nobodyPrevents("up:history:push",{url:e,message:"Adding history entry for "+e})?void 0:(i("pushState",e),up.emit("up:history:pushed",{url:e,message:"Advanced to location "+e}))},i=function(e,n){var o;return up.browser.canPushState()?(o=t(),window.history[e](o,"",n),s(r())):v.error("This browser doesn't support history."+e)},t=function(){return{fromUp:!0}},h=function(e){var t;return(null!=e?e.fromUp:void 0)?(t=r(),up.log.group("Restoring URL %s",t,function(){var e;return e=n.popTargets.join(", "),up.replace(e,t,{history:!1,title:!0,reveal:!1,transition:"none",saveScroll:!1,restoreScroll:n.restoreScroll})})):up.puts("Ignoring a state not pushed by Unpoly (%o)",e)},l=function(e){var t,n;return s(r()),up.layout.saveScroll({url:c}),t=e.originalEvent.state,h(t),n=r(),up.emit("up:history:restored",{url:n,message:"Restored location "+n})},up.browser.canPushState()&&(f=function(){return e(window).on("popstate",l),d(r(),{force:!0})},"undefined"!=typeof jasmine&&null!==jasmine?f():setTimeout(f,100)),up.compiler("[up-back]",function(e){return v.isPresent(c)?(v.setMissingAttrs(e,{"up-href":c,"up-restore-scroll":""}),e.removeAttr("up-back"),up.link.makeFollowable(e)):void 0}),up.on("up:framework:reset",m),{config:n,defaults:function(){return v.error("up.history.defaults(...) no longer exists. Set values on he up.history.config property instead.")},push:p,replace:d,url:r,previousUrl:function(){return c},normalizeUrl:a}}(jQuery)}.call(this),function(){var slice=[].slice;up.layout=function($){var SCROLL_PROMISE_KEY,anchoredRight,config,finishScrolling,fixedChildren,lastScrollTops,measureObstruction,reset,restoreScroll,reveal,revealOrRestoreScroll,saveScroll,scroll,scrollTops,u,viewportOf,viewportSelector,viewports,viewportsWithin;return u=up.util,config=u.config({duration:0,viewports:[document,".up-modal-viewport","[up-viewport]"],fixedTop:["[up-fixed~=top]"],fixedBottom:["[up-fixed~=bottom]"],anchoredRight:["[up-anchored~=right]","[up-fixed~=top]","[up-fixed~=bottom]","[up-fixed~=right]"],snap:50,substance:150,easing:"swing"}),lastScrollTops=u.cache({size:30,key:up.history.normalizeUrl}),reset=function(){return config.reset(),lastScrollTops.clear()},SCROLL_PROMISE_KEY="up-scroll-promise",scroll=function(e,t,n){var r,o,i,a,s;return r=$(e),n=u.options(n),i=u.option(n.duration,config.duration),a=u.option(n.easing,config.easing),finishScrolling(r),i>0?(o=$.Deferred(),r.data(SCROLL_PROMISE_KEY,o),o.then(function(){return r.removeData(SCROLL_PROMISE_KEY),r.finish()}),s={scrollTop:t},r.get(0)===document&&(r=$("html, body")),r.animate(s,{duration:i,easing:a,complete:function(){return o.resolve()}}),o):(r.scrollTop(t),u.resolvedDeferred())},finishScrolling=function(e){return $(e).each(function(){var e;return(e=$(this).data(SCROLL_PROMISE_KEY))?e.resolve():void 0})},anchoredRight=function(){return u.multiSelector(config.anchoredRight).select()},measureObstruction=function(){var e,t,n,r;return n=function(e,t){var n,r;return n=$(e),r=n.css(t),u.isPresent(r)||u.error("Fixed element %o must have a CSS attribute %s",n.get(0),t),parseInt(r)+n.height()},t=function(){var e,t,o,i;for(o=$(config.fixedTop.join(", ")),i=[],e=0,t=o.length;t>e;e++)r=o[e],i.push(n(r,"top"));return i}(),e=function(){var e,t,o,i;for(o=$(config.fixedBottom.join(", ")),i=[],e=0,t=o.length;t>e;e++)r=o[e],i.push(n(r,"bottom"));return i}(),{top:Math.max.apply(Math,[0].concat(slice.call(t))),bottom:Math.max.apply(Math,[0].concat(slice.call(e)))}},reveal=function(e,t){var n,r,o,i,a,s,l,c,p,f,d,m,h,v;return n=$(e),up.puts("Revealing fragment %o",e.get(0)),t=u.options(t),r=t.viewport?$(t.viewport):viewportOf(n),m=u.option(t.snap,config.snap),v=r.is(document),h=v?u.clientSize().height:r.height(),p=r.scrollTop(),s=p,c=void 0,l=void 0,v?(l=measureObstruction(),c=0):(l={top:0,bottom:0},c=p),f=function(){return s+l.top},d=function(){return s+h-l.bottom-1},o=u.measure(n,{relative:r}),i=o.top+c,a=i+Math.min(o.height,config.substance)-1,a>d()&&(s+=a-d()),(i<f()||t.top)&&(s=i-l.top),m>s&&(s=0),s!==p?scroll(r,s,t):u.resolvedDeferred()},viewportSelector=function(){return u.multiSelector(config.viewports)},viewportOf=function(e,t){var n,r;return null==t&&(t={}),n=$(e),r=viewportSelector().seekUp(n),0===r.length&&t.strict!==!1&&u.error("Could not find viewport for %o",n),r},viewportsWithin=function(e){var t;return t=$(e),viewportSelector().findWithSelf(t)},viewports=function(){return viewportSelector().select()},scrollTops=function(){var e,t,n,r,o,i,u;for(i={},o=config.viewports,t=0,r=o.length;r>t;t++)u=o[t],e=$(u),e.length&&(n=u,u===document&&(n="document"),i[n]=e.scrollTop());return i},fixedChildren=function(e){var t,n;return null==e&&(e=void 0),
|
2
|
-
e||(e=document.body),n=$(e),t=n.find("[up-fixed]"),u.isPresent(config.fixedTop)&&(t=t.add(n.find(config.fixedTop.join(", ")))),u.isPresent(config.fixedBottom)&&(t=t.add(n.find(config.fixedBottom.join(", ")))),t},saveScroll=function(e){var t,n;return null==e&&(e={}),n=u.option(e.url,up.history.url()),t=u.option(e.tops,scrollTops()),up.puts("Saving scroll positions for URL %s (%o)",n,t),lastScrollTops.set(n,t)},restoreScroll=function(e){var t,n,r,o,i;return null==e&&(e={}),i=up.history.url(),r=void 0,e.around?(n=viewportsWithin(e.around),t=viewportOf(e.around),r=t.add(n)):r=viewports(),o=lastScrollTops.get(i),up.log.group("Restoring scroll positions for URL %s to %o",i,o,function(){var e,t,n,i;for(t in o)i=o[t],n="document"===t?document:t,e=r.filter(n),scroll(e,i,{duration:0});return u.resolvedDeferred()})},revealOrRestoreScroll=function(e,t){var n,r,o,i;return n=$(e),t.restoreScroll?restoreScroll({around:n}):t.reveal?(t.source&&(i=u.parseUrl(t.source),i.hash&&"#"!==i.hash&&(o=i.hash.substr(1),r=u.findWithSelf(n,"#"+o+", a[name='"+o+"']"),r.length&&(n=r))),reveal(n)):u.resolvedDeferred()},up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),reveal:reveal,scroll:scroll,finishScrolling:finishScrolling,config:config,defaults:function(){return u.error("up.layout.defaults(...) no longer exists. Set values on he up.layout.config property instead.")},viewportOf:viewportOf,viewportsWithin:viewportsWithin,viewports:viewports,scrollTops:scrollTops,saveScroll:saveScroll,restoreScroll:restoreScroll,revealOrRestoreScroll:revealOrRestoreScroll,anchoredRight:anchoredRight,fixedChildren:fixedChildren}}(jQuery),up.scroll=up.layout.scroll,up.reveal=up.layout.reveal}.call(this),function(){up.flow=function($){var autofocus,config,destroy,emitFragmentInserted,emitFragmentKept,extract,filterScripts,findKeepPlan,findOldFragment,first,firstInLayer,firstInPriority,hello,isRealElement,layerOf,matchesLayer,oldFragmentNotFound,parseImplantSteps,parseResponse,processResponse,reload,replace,reset,resolveSelector,setSource,source,swapElements,transferKeepableElements,u,updateHistory;return u=up.util,config=u.config({runInlineScripts:!0,runLinkedScripts:!1}),reset=function(){return config.reset()},setSource=function(e,t){var n;return n=$(e),u.isPresent(t)&&(t=u.normalizeUrl(t)),n.attr("up-source",t)},source=function(e){var t;return t=$(e).closest("[up-source]"),u.presence(t.attr("up-source"))||up.browser.url()},resolveSelector=function(e,t){var n,r;return u.isString(e)?(r=e,u.contains(r,"&")&&(t?(n=u.selectorForElement(t),r=r.replace(/\&/,n)):u.error("Found origin reference (%s) in selector %s, but options.origin is missing","&",r))):r=u.selectorForElement(e),r},replace=function(e,t,n){var r,o,i,a,s,l;return up.puts("Replacing %s from %s (%o)",e,t,n),n=u.options(n),l=resolveSelector(e,n.origin),r=u.option(n.failTarget,"body"),r=resolveSelector(r,n.origin),up.browser.canPushState()||n.history===!1?(s={url:t,method:n.method,data:n.data,target:l,failTarget:r,cache:n.cache,preload:n.preload,headers:n.headers},a=up.ajax(s),i=function(e,r,o){return processResponse(!0,l,t,s,o,n)},o=function(e,o,i){return processResponse(!1,r,t,s,e,n)},a=a.then(i,o)):(n.preload||up.browser.loadPage(t,u.only(n,"method","data")),u.unresolvablePromise())},processResponse=function(e,t,n,r,o,i){var a,s,l,c;return i.method=u.normalizeMethod(u.option(u.methodFromXhr(o),i.method)),i.title=u.option(u.titleFromXhr(o),i.title),i.title===!1||u.isString(i.title)||i.history===!1&&i.title!==!0||(i.title=u.titleFromXhr(o)),a="GET"===i.method,(c=u.locationFromXhr(o))?(n=c,e&&up.proxy.isCachable(r)&&(s={url:n,method:u.methodFromXhr(o),target:t},up.proxy.alias(r,s))):a&&(l=u.requestDataAsQuery(i.data))&&(n=n+"?"+l),e?a?(i.history===!1||u.isString(i.history)||(i.history=n),i.source===!1||u.isString(i.source)||(i.source=n)):(u.isString(i.history)||(i.history=!1),u.isString(i.source)||(i.source="keep")):(i.transition=i.failTransition,i.failTransition=void 0,a?(i.history!==!1&&(i.history=n),i.source!==!1&&(i.source=n)):(i.source="keep",i.history=!1)),i.preload?u.resolvedPromise():extract(t,o.responseText,i)},extract=function(e,t,n){return up.log.group("Extracting %s from %d bytes of HTML",e,null!=t?t.length:void 0,function(){var r,o,i;return n=u.options(n,{historyMethod:"push",requireMatch:!0,keep:!0,layer:"auto"}),i=resolveSelector(e,n.origin),o=parseResponse(t,n),n.title||(n.title=o.title()),n.saveScroll!==!1&&up.layout.saveScroll(),r=u.resolvedPromise(),n.beforeSwap&&(r=r.then(n.beforeSwap)),r=r.then(function(){return updateHistory(n)}),r=r.then(function(){var e,t,r,u,a;for(a=[],r=parseImplantSteps(i,n),e=0,t=r.length;t>e;e++)u=r[e],up.log.group("Updating %s",u.selector,function(){var e,t,r,i;return t=findOldFragment(u.selector,n),e=null!=(r=o.find(u.selector))?r.first():void 0,t&&e?(filterScripts(e,n),i=swapElements(t,e,u.pseudoClass,u.transition,n),a.push(i),n.reveal=!1):void 0});return $.when.apply($,a)}),n.afterSwap&&(r=r.then(n.afterSwap)),r})},findOldFragment=function(e,t){return first(e,t)||oldFragmentNotFound(e,t)},oldFragmentNotFound=function(e,t){var n,r;return t.requireMatch?(n=t.layer,"auto"===n&&(n="page, modal or popup"),r="Could not find selector %s in the current "+n,"#"===r[0]&&(r+=" (avoid using IDs)"),u.error(r,e)):void 0},filterScripts=function(e,t){var n,r,o,i,a,s,l,c,p,f;for(c=u.option(t.runInlineScripts,config.runInlineScripts),p=u.option(t.runLinkedScripts,config.runLinkedScripts),r=u.findWithSelf(e,"script"),l=[],a=0,s=r.length;s>a;a++)f=r[a],n=$(f),i=u.isPresent(n.attr("src")),o=!i,i&&p||o&&c?l.push(void 0):l.push(n.remove());return l},parseResponse=function(e,t){var n;return n=u.createElementFromHtml(e),{title:function(){var e;return null!=(e=n.querySelector("title"))?e.textContent:void 0},find:function(r){var o;return(o=$.find(r,n)[0])?$(o):t.requireMatch?u.error("Could not find selector %s in response %o",r,e):void 0}}},updateHistory=function(e){return e.title&&(document.title=e.title),e.history?up.history[e.historyMethod](e.history):void 0},swapElements=function(e,t,n,r,o){var i,a,s,l;return r||(r="none"),"keep"===o.source&&(o=u.merge(o,{source:source(e)})),up.motion.finish(e),n?(i=t.contents().wrapAll('<div class="up-insertion"></div>').parent(),"before"===n?e.prepend(i):e.append(i),hello(i.children(),o),s=up.layout.revealOrRestoreScroll(i,o),s=s.then(function(){return up.animate(i,r,o)}),s=s.then(function(){return u.unwrapElement(i)})):(a=findKeepPlan(e,t,o))?(emitFragmentKept(a),s=u.resolvedPromise()):(l=function(){return o.keepPlans=transferKeepableElements(e,t,o),e.is("body")?(up.syntax.clean(e),e.replaceWith(t)):t.insertBefore(e),o.source!==!1&&setSource(t,o.source),autofocus(t),hello(t,o),up.morph(e,t,r,o)},s=destroy(e,{animation:l})),s},transferKeepableElements=function(e,t,n){var r,o,i,a,s,l,c,p;if(a=[],n.keep)for(p=e.find("[up-keep]"),i=0,l=p.length;l>i;i++)s=p[i],r=$(s),(c=findKeepPlan(r,t,u.merge(n,{descendantsOnly:!0})))&&(o=r.clone(),r.replaceWith(o),c.$newElement.replaceWith(r),a.push(c));return a},findKeepPlan=function(e,t,n){var r,o,i,a,s;return n.keep&&(r=e,(s=u.castedAttr(r,"up-keep"))&&(u.isString(s)||(s="&"),s=resolveSelector(s,r),o=n.descendantsOnly?t.find(s):u.findWithSelf(t,s),o=o.first(),o.length&&o.is("[up-keep]")&&(i={$element:r,$newElement:o,newData:up.syntax.data(o)},a=u.merge(i,{message:["Keeping element %o",r.get(0)]}),up.bus.nobodyPrevents("up:fragment:keep",a))))?i:void 0},parseImplantSteps=function(e,t){var n,r,o,i,a,s,l,c,p,f,d,m;for(d=t.transition||t.animation||"none",n=/\ *,\ */,r=e.split(n),m=u.isString(m)?d.split(n):[d],l=[],o=i=0,a=r.length;a>i;o=++i)c=r[o],p=c.match(/^(.+?)(?:\:(before|after))?$/),p||u.error('Could not parse selector atom "%s"',c),e=p[1],"html"===e&&(e="body"),s=p[2],f=m[o]||u.last(m),l.push({selector:e,pseudoClass:s,transition:f});return l},hello=function(e,t){var n,r,o,i,a,s;for(n=$(e),t=u.options(t,{keepPlans:[]}),o=[],s=t.keepPlans,r=0,i=s.length;i>r;r++)a=s[r],emitFragmentKept(a),o.push(a.$element);return up.syntax.compile(n,{skip:o}),emitFragmentInserted(n,t),n},emitFragmentInserted=function(e,t){var n;return n=$(e),up.emit("up:fragment:inserted",{$element:n,message:["Inserted fragment %o",n.get(0)],origin:t.origin})},emitFragmentKept=function(e){var t;return t=u.merge(e,{message:["Kept fragment %o",e.$element.get(0)]}),up.emit("up:fragment:kept",t)},autofocus=function(e){var t,n;return n="[autofocus]:last",t=u.findWithSelf(e,n),t.length&&t.get(0)!==document.activeElement?t.focus():void 0},isRealElement=function(e){var t;return t=".up-ghost, .up-destroying",0===e.closest(t).length},first=function(e,t){return t=u.options(t,{layer:"auto"}),"auto"===t.layer?firstInPriority(e,t.origin):firstInLayer(e,t.layer)},firstInPriority=function(e,t){var n,r,o,i,a,s;for(i=["popup","modal","page"],n=void 0,u.isPresent(t)&&(s=layerOf(t),u.remove(i,s),i.unshift(s)),r=0,a=i.length;a>r&&(o=i[r],!(n=firstInLayer(e,o)));r++);return n},firstInLayer=function(e,t){var n,r,o,i,u,a;for(r=$(e),o=void 0,u=0,a=r.length;a>u;u++)if(i=r[u],n=$(i),isRealElement(n)&&matchesLayer(n,t)){o=n;break}return o},layerOf=function(e){var t;return t=$(e),up.popup.contains(t)?"popup":up.modal.contains(t)?"modal":"page"},matchesLayer=function(e,t){return layerOf(e)===t},destroy=function(e,t){var n,r,o,i,a;return n=$(e),n.is(".up-placeholder, .up-tooltip, .up-modal, .up-popup")||(i=["Destroying fragment %o",n.get(0)],a=["Destroyed fragment %o",n.get(0)]),0===n.length?u.resolvedDeferred():up.bus.nobodyPrevents("up:fragment:destroy",{$element:n,message:i})?(t=u.options(t,{animation:!1}),r=up.motion.animateOptions(t),n.addClass("up-destroying"),u.isPresent(t.url)&&up.history.push(t.url),u.isPresent(t.title)&&(document.title=t.title),o=u.presence(t.animation,u.isDeferred)||up.motion.animate(n,t.animation,r),o.then(function(){return up.syntax.clean(n),up.emit("up:fragment:destroyed",{$element:n,message:a}),n.remove()}),o):$.Deferred()},reload=function(e,t){var n;return t=u.options(t,{cache:!1}),n=t.url||source(e),replace(e,n,t)},up.on("up:app:boot",function(){var e;return e=$(document.body),setSource(e,up.browser.url()),hello(e)}),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),replace:replace,reload:reload,destroy:destroy,extract:extract,first:first,source:source,resolveSelector:resolveSelector,hello:hello,config:config}}(jQuery),up.replace=up.flow.replace,up.extract=up.flow.extract,up.reload=up.flow.reload,up.destroy=up.flow.destroy,up.first=up.flow.first,up.hello=up.flow.hello}.call(this),function(){var e=[].slice;up.motion=function(t){var n,r,o,i,u,a,s,l,c,p,f,d,m,h,v,g,y,b,w,k,S,A,x,$,D,T,E,C;return E=up.util,a={},c={},D={},p={},l=E.config({duration:300,delay:0,easing:"ease",enabled:!0}),k=function(){return m(),a=E.copy(c),D=E.copy(p),l.reset()},v=function(){return l.enabled&&up.browser.canCssTransition()},o=function(e,n,r){var u;return u=t(e),m(u),r=i(r),"none"===n||n===!1?b():E.isFunction(n)?s(n(u,r),n):E.isString(n)?o(u,d(n),r):E.isHash(n)?v()?E.cssAnimate(u,n,r):(u.css(n),E.resolvedDeferred()):E.error("Unknown animation type for %o",n)},i=function(){var t,n,r,o,i;return n=1<=arguments.length?e.call(arguments,0):[],i=n.shift()||{},t=E.isJQuery(n[0])?n.shift():E.nullJQuery(),o=E.isObject(n[0])?n.shift():{},r={},r.easing=E.option(i.easing,E.presentAttr(t,"up-easing"),o.easing,l.easing),r.duration=Number(E.option(i.duration,E.presentAttr(t,"up-duration"),o.duration,l.duration)),r.delay=Number(E.option(i.delay,E.presentAttr(t,"up-delay"),o.delay,l.delay)),r},d=function(e){return a[e]||E.error("Unknown animation %o",e)},r="up-ghosting-deferred",n="up-ghosting",C=function(e,t,o,i){var u,a,s,l,c,p,f,d;return o.copy===!1||e.is(".up-ghost")||t.is(".up-ghost")?i(e,t):(p=void 0,l=void 0,f=void 0,c=void 0,a=up.layout.viewportOf(e),u=e.add(t),E.temporaryCss(t,{display:"none"},function(){return p=w(e,a),f=a.scrollTop()}),E.temporaryCss(e,{display:"none"},function(){return up.layout.revealOrRestoreScroll(t,o),l=w(t,a),c=a.scrollTop()}),p.moveTop(c-f),e.hide(),d=E.temporaryCss(t,{opacity:"0"}),s=i(p.$ghost,l.$ghost),u.data(r,s),u.addClass(n),s.then(function(){return u.removeData(r),u.removeClass(n),d(),p.$bounds.remove(),l.$bounds.remove()}),s)},m=function(e){var r,o,i;return null==e&&(e=".up-animating"),o=t(e),r=E.findWithSelf(o,".up-animating"),E.finishCssAnimate(r),i=E.findWithSelf(o,"."+n),h(i)},h=function(e){return e.each(function(){var e,n;return e=t(this),(n=E.pluckData(e,r))?n.resolve():void 0})},s=function(e,t){return E.isDeferred(e)?e:E.error("Did not return a promise with .then and .resolve methods: %o",t)},y=function(e,n,r,u){var l,c;return"none"===r&&(r=!1),u=E.options(u),c=t(e),l=t(n),f(c,r),f(l,r),up.log.group(r?"Morphing %o to %o (using %s, %o)":void 0,c.get(0),l.get(0),r,u,function(){var e,t,n,p;return t=E.only(u,"reveal","restoreScroll","source"),t=E.extend(t,i(u)),v()?(m(c),m(l),r?(e=a[r])?(A(c,l,t),o(l,e,t)):(p=E.presence(r,E.isFunction)||D[r])?C(c,l,t,function(e,n){var o;return o=p(e,n,t),s(o,r)}):E.isString(r)&&r.indexOf("/")>=0?(n=r.split("/"),p=function(e,t,r){return S(o(e,n[0],r),o(t,n[1],r))},y(c,l,p,t)):E.error("Unknown transition %o",r):A(c,l,t)):A(c,l,t)})},f=function(e,t){var n;return t&&0===e.parents("body").length?(n=e.get(0),E.error("Can't morph a <%s> element (%o)",n.tagName,n)):void 0},A=function(e,t,n){return e.hide(),up.layout.revealOrRestoreScroll(t,n)},w=function(e,n){var r,o,i,u,a,s,l,c,p;for(u=E.measure(e,{relative:!0,inner:!0}),i=e.clone(),i.find("script").remove(),i.css({position:"static"===e.css("position")?"static":"relative",top:"auto",right:"auto",bottom:"auto",left:"auto",width:"100%",height:"100%"}),i.addClass("up-ghost"),r=t('<div class="up-bounds"></div>'),r.css({position:"absolute"}),r.css(u),p=u.top,c=function(e){return 0!==e?(p+=e,r.css({top:p})):void 0},i.appendTo(r),r.insertBefore(e),c(e.offset().top-i.offset().top),o=up.layout.fixedChildren(i),s=0,l=o.length;l>s;s++)a=o[s],E.fixedToAbsolute(a,n);return{$ghost:i,$bounds:r,moveTop:c}},$=function(e,t){return D[e]=t},u=function(e,t){return a[e]=t},x=function(){return c=E.copy(a),p=E.copy(D)},S=E.resolvableWhen,b=E.resolvedDeferred,g=function(e){return e===!1||"none"===e||e===b},u("none",b),u("fade-in",function(e,t){return e.css({opacity:0}),o(e,{opacity:1},t)}),u("fade-out",function(e,t){return e.css({opacity:1}),o(e,{opacity:0},t)}),T=function(e,t){return{transform:"translate("+e+"px, "+t+"px)"}},u("move-to-top",function(e,t){var n,r;return n=E.measure(e),r=n.top+n.height,e.css(T(0,0)),o(e,T(0,-r),t)}),u("move-from-top",function(e,t){var n,r;return n=E.measure(e),r=n.top+n.height,e.css(T(0,-r)),o(e,T(0,0),t)}),u("move-to-bottom",function(e,t){var n,r;return n=E.measure(e),r=E.clientSize().height-n.top,e.css(T(0,0)),o(e,T(0,r),t)}),u("move-from-bottom",function(e,t){var n,r;return n=E.measure(e),r=E.clientSize().height-n.top,e.css(T(0,r)),o(e,T(0,0),t)}),u("move-to-left",function(e,t){var n,r;return n=E.measure(e),r=n.left+n.width,e.css(T(0,0)),o(e,T(-r,0),t)}),u("move-from-left",function(e,t){var n,r;return n=E.measure(e),r=n.left+n.width,e.css(T(-r,0)),o(e,T(0,0),t)}),u("move-to-right",function(e,t){var n,r;return n=E.measure(e),r=E.clientSize().width-n.left,e.css(T(0,0)),o(e,T(r,0),t)}),u("move-from-right",function(e,t){var n,r;return n=E.measure(e),r=E.clientSize().width-n.left,e.css(T(r,0)),o(e,T(0,0),t)}),u("roll-down",function(e,t){var n,r,i;return r=e.height(),i=E.temporaryCss(e,{height:"0px",overflow:"hidden"}),n=o(e,{height:r+"px"},t),n.then(i),n}),$("none",b),$("move-left",function(e,t,n){return S(o(e,"move-to-left",n),o(t,"move-from-right",n))}),$("move-right",function(e,t,n){return S(o(e,"move-to-right",n),o(t,"move-from-left",n))}),$("move-up",function(e,t,n){return S(o(e,"move-to-top",n),o(t,"move-from-bottom",n))}),$("move-down",function(e,t,n){return S(o(e,"move-to-bottom",n),o(t,"move-from-top",n))}),$("cross-fade",function(e,t,n){return S(o(e,"fade-out",n),o(t,"fade-in",n))}),up.on("up:framework:booted",x),up.on("up:framework:reset",k),{morph:y,animate:o,animateOptions:i,finish:m,transition:$,animation:u,config:l,isEnabled:v,defaults:function(){return E.error("up.motion.defaults(...) no longer exists. Set values on he up.motion.config property instead.")},none:b,when:S,prependCopy:w,isNone:g}}(jQuery),up.transition=up.motion.transition,up.animation=up.motion.animation,up.morph=up.motion.morph,up.animate=up.motion.animate}.call(this),function(){var e=[].slice;up.proxy=function(t){var n,r,o,i,u,a,s,l,c,p,f,d,m,h,v,g,y,b,w,k,S,A,x,$,D,T,E,C,P,O,F,U,R,_;return _=up.util,n=void 0,$=void 0,F=void 0,S=void 0,U=void 0,T=[],p=_.config({slowDelay:300,preloadDelay:75,cacheSize:70,cacheExpiry:3e5,maxRequests:4,wrapMethods:["PATCH","PUT","DELETE"],wrapMethodParam:"_method",safeMethods:["GET","OPTIONS","HEAD"]}),u=function(e){return k(e),[e.url,e.method,_.requestDataAsQuery(e.data),e.target].join("|")},i=_.cache({size:function(){return p.cacheSize},expiry:function(){return p.cacheExpiry},key:u}),f=function(e){var t,n,r,o,u,a,s;if(e=k(e),m(e))for(n=[e],"html"!==e.target&&(a=_.merge(e,{target:"html"}),n.push(a),"body"!==e.target&&(u=_.merge(e,{target:"body"}),n.push(u))),r=0,o=n.length;o>r;r++)if(t=n[r],s=i.get(t))return s},a=function(){return clearTimeout($),$=null},s=function(){return clearTimeout(F),F=null},C=function(){return n=null,a(),s(),S=0,p.reset(),i.clear(),U=!1,T=[]},C(),k=function(e){return e._normalized||(e.method=_.normalizeMethod(e.method),e.url&&(e.url=_.normalizeUrl(e.url)),e.target||(e.target="body"),e._normalized=!0),e},r=function(){var t,n,r,o,i,u,a;return t=1<=arguments.length?e.call(arguments,0):[],o=_.extractOptions(t),_.isGiven(t[0])&&(o.url=t[0]),n=o.cache===!0,r=o.cache===!1,a=_.only(o,"url","method","data","target","headers","_normalized"),a=k(a),i=!0,h(a)||n?(u=f(a))&&!r?(up.puts("Re-using cached response for %s %s",a.method,a.url),i="pending"===u.state()):(u=b(a),O(a,u),u.fail(function(){return E(a)})):(c(),u=b(a)),i&&!o.preload&&(w(),u.always(y)),u},m=function(e){return!_.isFormData(e.data)},v=function(){return 0===S},d=function(){return S>0},w=function(){var e,t;return t=v(),S+=1,t?(e=function(){return d()?(up.emit("up:proxy:slow",{message:"Proxy is busy"}),U=!0):void 0},F=_.setTimer(p.slowDelay,e)):void 0},y=function(){return S-=1,v()&&U?(up.emit("up:proxy:recover",{message:"Proxy is idle"}),U=!1):void 0},b=function(e){return S<p.maxRequests?g(e):D(e)},D=function(e){var n,r;return up.puts("Queuing request for %s %s",e.method,e.url),n=t.Deferred(),r={deferred:n,request:e},T.push(r),n.promise()},g=function(e){var n;return up.emit("up:proxy:load",_.merge(e,{message:["Loading %s %s",e.method,e.url]})),e=_.copy(e),e.headers||(e.headers={}),e.headers["X-Up-Target"]=e.target,_.contains(p.wrapMethods,e.method)&&(e.data=_.appendRequestData(e.data,p.wrapMethodParam,e.method),e.method="POST"),_.isFormData(e.data)&&(e.contentType=!1,e.processData=!1),n=t.ajax(e),n.done(function(t,n,r){return P(e,r)}),n.fail(function(t,n,r){return P(e,t)}),n},P=function(e,t){var n;return up.emit("up:proxy:received",_.merge(e,{message:["Server responded with %s %s (%d bytes)",t.status,t.statusText,null!=(n=t.responseText)?n.length:void 0]})),A()},A=function(){var t,n;(t=T.shift())&&(n=g(t.request),n.done(function(){var n,r;return n=1<=arguments.length?e.call(arguments,0):[],(r=t.deferred).resolve.apply(r,n)}),n.fail(function(){var n,r;return n=1<=arguments.length?e.call(arguments,0):[],(r=t.deferred).reject.apply(r,n)}))},o=i.alias,O=i.set,E=i.remove,c=i.clear,h=function(e){return k(e),_.contains(p.safeMethods,e.method)},l=function(e){var t,r;return r=parseInt(_.presentAttr(e,"up-delay"))||p.preloadDelay,e.is(n)?void 0:(n=e,a(),t=function(){return x(e),n=null},R(t,r))},R=function(e,t){return $=setTimeout(e,t)},x=function(e,n){var r,o;return r=t(e),n=_.options(n),o=up.link.followMethod(r,n),h({method:o})?up.log.group("Preloading link %o",r,function(){return n.preload=!0,up.follow(r,n)}):(up.puts("Won't preload %o due to unsafe method %s",r,o),_.resolvedPromise())},up.on("mouseover mousedown touchstart","[up-preload]",function(e,t){return up.link.childClicked(e,t)?void 0:l(t)}),up.on("up:framework:reset",C),{preload:x,ajax:r,get:f,alias:o,clear:c,remove:E,isIdle:v,isBusy:d,isCachable:m,config:p,defaults:function(){return _.error("up.proxy.defaults(...) no longer exists. Set values on he up.proxy.config property instead.")}}}(jQuery),up.ajax=up.proxy.ajax}.call(this),function(){up.link=function($){var allowDefault,childClicked,follow,followMethod,followVariantSelectors,isFollowable,makeFollowable,onAction,shouldProcessLinkEvent,u,visit;return u=up.util,visit=function(e,t){var n;return t=u.options(t),n=u.option(t.target,"body"),up.replace(n,e,t)},follow=function(e,t){var n,r,o;return n=$(e),t=u.options(t),o=u.option(n.attr("up-href"),n.attr("href")),r=u.option(t.target,n.attr("up-target"),"body"),t.failTarget=u.option(t.failTarget,n.attr("up-fail-target"),"body"),t.transition=u.option(t.transition,u.castedAttr(n,"up-transition"),"none"),t.failTransition=u.option(t.failTransition,u.castedAttr(n,"up-fail-transition"),"none"),t.history=u.option(t.history,u.castedAttr(n,"up-history")),t.reveal=u.option(t.reveal,u.castedAttr(n,"up-reveal"),!0),t.cache=u.option(t.cache,u.castedAttr(n,"up-cache")),t.restoreScroll=u.option(t.restoreScroll,u.castedAttr(n,"up-restore-scroll")),t.method=followMethod(n,t),t.origin=u.option(t.origin,n),t.layer=u.option(t.layer,n.attr("up-layer"),"auto"),t.confirm=u.option(t.confirm,n.attr("up-confirm")),t=u.merge(t,up.motion.animateOptions(t,n)),up.browser.whenConfirmed(t).then(function(){return up.replace(r,o,t)})},followMethod=function(e,t){var n;return n=$(e),t=u.options(t),u.option(t.method,n.attr("up-method"),n.attr("data-method"),"get").toUpperCase()},childClicked=function(e,t){var n,r;return n=$(e.target),r=n.closest("a, [up-href]"),r.length&&t.find(r).length},shouldProcessLinkEvent=function(e,t){return u.isUnmodifiedMouseEvent(e)&&!childClicked(e,t)},followVariantSelectors=[],allowDefault=function(e){},onAction=function(e,t){var n;return followVariantSelectors.push(e),n=function(e){return up.navigation.withActiveMark(e,{enlarge:!0},function(){return t(e)})},up.on("click","a"+e+", [up-href]"+e,function(e,t){return shouldProcessLinkEvent(e,t)?t.is("[up-instant]")?e.preventDefault():(e.preventDefault(),n(t)):allowDefault(e)}),up.on("mousedown","a"+e+"[up-instant], [up-href]"+e+"[up-instant]",function(e,t){return shouldProcessLinkEvent(e,t)?(e.preventDefault(),n(t)):void 0})},isFollowable=function(e){return u.any(followVariantSelectors,function(t){return e.is(t)})},makeFollowable=function(e){var t;return t=$(e),isFollowable(t)?void 0:t.attr("up-follow","")},onAction("[up-target]",function(e){return follow(e)}),onAction("[up-follow]",function(e){return follow(e)}),up.macro("[up-dash]",{priority:"last"},function(e){var t,n;return n=u.castedAttr(e,"up-dash"),e.removeAttr("up-dash"),t={"up-preload":"","up-instant":""},n===!0?makeFollowable(e):t["up-target"]=n,u.setMissingAttrs(e,t)}),up.macro("[up-expand]",{priority:"last"},function(e){var t,n,r,o,i,a,s,l,c,p;if(t=e.find("a, [up-href]"),(c=e.attr("up-expand"))&&(t=t.filter(c)),i=t.get(0)){for(p=/^up-/,s={},s["up-href"]=$(i).attr("href"),l=i.attributes,r=0,o=l.length;o>r;r++)n=l[r],a=n.name,a.match(p)&&(s[a]=n.value);return u.setMissingAttrs(e,s),e.removeAttr("up-expand"),makeFollowable(e)}}),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),visit:visit,follow:follow,makeFollowable:makeFollowable,shouldProcessLinkEvent:shouldProcessLinkEvent,childClicked:childClicked,followMethod:followMethod,onAction:onAction}}(jQuery),up.visit=up.link.visit,up.follow=up.link.follow}.call(this),function(){var slice=[].slice;up.form=function($){var autosubmit,config,currentValuesForSwitch,observe,observeForm,reset,resolveValidateTarget,submit,switchTargets,u,validate;return u=up.util,config=u.config({validateTargets:["[up-fieldset]:has(&)","fieldset:has(&)","label:has(&)","form:has(&)"],fields:[":input"],observeDelay:0}),reset=function(){return config.reset()},submit=function(e,t){var n,r,o,i,a,s,l;return n=$(e).closest("form"),t=u.options(t),s=u.option(t.target,n.attr("up-target"),"body"),l=u.option(t.url,n.attr("action"),up.browser.url()),t.failTarget=u.option(t.failTarget,n.attr("up-fail-target"))||u.selectorForElement(n),t.history=u.option(t.history,u.castedAttr(n,"up-history"),!0),t.transition=u.option(t.transition,u.castedAttr(n,"up-transition"),"none"),t.failTransition=u.option(t.failTransition,u.castedAttr(n,"up-fail-transition"),"none"),t.method=u.option(t.method,n.attr("up-method"),n.attr("data-method"),n.attr("method"),"post").toUpperCase(),t.headers=u.option(t.headers,{}),t.reveal=u.option(t.reveal,u.castedAttr(n,"up-reveal"),!0),t.cache=u.option(t.cache,u.castedAttr(n,"up-cache")),t.restoreScroll=u.option(t.restoreScroll,u.castedAttr(n,"up-restore-scroll")),t.origin=u.option(t.origin,n),t.layer=u.option(t.layer,n.attr("up-layer"),"auto"),t.data=up.util.requestDataFromForm(n),t=u.merge(t,up.motion.animateOptions(t,n)),i=n.find("input[type=file]").length,r=!i||u.isFormData(t.data),o=up.browser.canPushState()||t.history===!1,t.validate&&(t.headers||(t.headers={}),t.transition=!1,t.failTransition=!1,t.headers["X-Up-Validate"]=t.validate,!r)?u.unresolvablePromise():(up.navigation.markActive(n),r&&o?(a=up.replace(s,l,t),a.always(function(){return up.navigation.unmarkActive(n)}),a):(n.get(0).submit(),u.unresolvablePromise()))},observe=function(){var $element,args,callback,callbackArg,callbackPromise,callbackTimer,changeEvents,check,clearTimer,delay,knownValue,nextCallback,options,rawCallback,runNextCallback,selectorOrElement;return selectorOrElement=arguments[0],args=2<=arguments.length?slice.call(arguments,1):[],options={},callbackArg=void 0,1===args.length&&(callbackArg=args[0]),args.length>1&&(options=u.options(args[0]),callbackArg=args[1]),$element=$(selectorOrElement),options=u.options(options),delay=u.option($element.attr("up-delay"),options.delay,config.observeDelay),delay=parseInt(delay),callback=null,u.isGiven(options.change)&&u.error("up.observe now takes the change callback as the last argument"),rawCallback=u.option(u.presentAttr($element,"up-observe"),callbackArg),callback=u.isString(rawCallback)?function(value,$field){return eval(rawCallback)}:rawCallback||u.error("up.observe: No change callback given"),$element.is("form")?observeForm($element,options,callback):(knownValue=null,callbackTimer=null,callbackPromise=u.resolvedPromise(),nextCallback=null,runNextCallback=function(){var e;return nextCallback?(e=nextCallback(),nextCallback=null,e):void 0},check=function(){var e,t,n;return n=$element.val(),t=u.isNull(knownValue),knownValue===n||(knownValue=n,t)?void 0:(clearTimer(),nextCallback=function(){return callback.apply($element.get(0),[n,$element])},e=function(){return callbackPromise.then(function(){var e;return e=runNextCallback(),callbackPromise=u.isPromise(e)?e:u.resolvedPromise()})},u.setTimer(delay,e))},clearTimer=function(){return clearTimeout(callbackTimer)},changeEvents=up.browser.canInputEvent()?"input change":"input change keypress paste cut click propertychange",$element.on(changeEvents,check),check(),function(){return $element.off(changeEvents,check),clearTimer()})},observeForm=function(e,t,n){var r,o;return r=u.multiSelector(config.fields).find(e),o=u.map(r,function(e){return observe(e,n)}),function(){var e,t,n,r;for(r=[],t=0,n=o.length;n>t;t++)e=o[t],r.push(e());return r}},autosubmit=function(e,t){return observe(e,t,function(e,t){var n;return n=t.closest("form"),up.navigation.withActiveMark(t,function(){return submit(n)})})},resolveValidateTarget=function(e,t){var n;return n=u.option(t.target,e.attr("up-validate")),u.isBlank(n)&&(n||(n=u.detect(config.validateTargets,function(n){var r;return r=up.flow.resolveSelector(n,t.origin),e.closest(r).length}))),u.isBlank(n)&&u.error("Could not find default validation target for %o (tried ancestors %o)",e.get(0),config.validateTargets),u.isString(n)||(n=u.selectorForElement(n)),n},validate=function(e,t){var n,r,o;return n=$(e),t=u.options(t),t.origin=n,t.target=resolveValidateTarget(n,t),t.failTarget=t.target,t.history=!1,t.headers=u.option(t.headers,{}),t.validate=n.attr("name")||"__none__",t=u.merge(t,up.motion.animateOptions(t,n)),r=n.closest("form"),o=up.submit(r,t)},currentValuesForSwitch=function(e){var t,n,r;return r=void 0,e.is("input[type=checkbox]")?r=e.is(":checked")?[":checked",":present",e.val()]:[":unchecked",":blank"]:e.is("input[type=radio]")?(t=e.closest("form, body").find("input[type='radio'][name='"+e.attr("name")+"']:checked"),r=t.length?[":checked",":present",t.val()]:[":unchecked",":blank"]):(n=e.val(),r=u.isPresent(n)?[":present",n]:[":blank"]),r},currentValuesForSwitch=function(e){var t,n,r,o;return e.is("input[type=checkbox]")?e.is(":checked")?(r=e.val(),n=":checked"):n=":unchecked":e.is("input[type=radio]")?(t=e.closest("form, body").find("input[type='radio'][name='"+e.attr("name")+"']:checked"),t.length?(n=":checked",r=t.val()):n=":unchecked"):r=e.val(),o=[],u.isPresent(r)?(o.push(r),o.push(":present")):o.push(":blank"),u.isPresent(n)&&o.push(n),o},switchTargets=function(e,t){var n,r,o;return n=$(e),t=u.options(t),o=u.option(t.target,n.attr("up-switch")),u.isPresent(o)||u.error("No switch target given for %o",n.get(0)),r=currentValuesForSwitch(n),$(o).each(function(){var e,t,n,o;return e=$(this),(t=e.attr("up-hide-for"))?(t=t.split(" "),n=0===u.intersect(r,t).length):(o=(o=e.attr("up-show-for"))?o.split(" "):[":present",":checked"],n=u.intersect(r,o).length>0),e.toggle(n)})},up.on("submit","form[up-target]",function(e,t){return e.preventDefault(),submit(t)}),up.on("change","[up-validate]",function(e,t){return validate(t)}),up.on("change","[up-switch]",function(e,t){return switchTargets(t)}),up.compiler("[up-switch]",function(e){return switchTargets(e)}),up.compiler("[up-observe]",function(e){return observe(e)}),up.compiler("[up-autosubmit]",function(e){return autosubmit(e)}),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),config:config,submit:submit,observe:observe,validate:validate,switchTargets:switchTargets}}(jQuery),up.submit=up.form.submit,up.observe=up.form.observe,up.autosubmit=up.form.autosubmit,up.validate=up.form.validate}.call(this),function(){up.popup=function($){var align,attachAsap,attachNow,autoclose,chain,closeAsap,closeNow,config,contains,createFrame,discardHistory,isOpen,reset,state,u;return u=up.util,config=u.config({openAnimation:"fade-in",closeAnimation:"fade-out",openDuration:150,closeDuration:100,openEasing:null,closeEasing:null,position:"bottom-right",history:!1}),state=u.config({phase:"closed",$anchor:null,$popup:null,position:null,sticky:null,url:null,coveredUrl:null,coveredTitle:null}),chain=new u.DivertibleChain,reset=function(){var e;return null!=(e=state.$popup)&&e.remove(),state.reset(),chain.reset(),config.reset()},align=function(){var e,t,n;switch(e={},n=u.measure(state.$popup),u.isFixed(state.$anchor)?(t=state.$anchor.get(0).getBoundingClientRect(),e.position="fixed"):t=u.measure(state.$anchor),state.position){case"bottom-right":e.top=t.top+t.height,e.left=t.left+t.width-n.width;break;case"bottom-left":e.top=t.top+t.height,e.left=t.left;break;case"top-right":e.top=t.top-n.height,e.left=t.left+t.width-n.width;break;case"top-left":e.top=t.top-n.height,e.left=t.left;break;default:u.error("Unknown position option '%s'",state.position)}return state.$popup.attr("up-position",state.position),state.$popup.css(e)},discardHistory=function(){return state.coveredTitle=null,state.coveredUrl=null},createFrame=function(e){var t;return t=u.$createElementFromSelector(".up-popup"),u.$createPlaceholder(e,t),t.appendTo(document.body),state.$popup=t},isOpen=function(){return"opened"===state.phase||"opening"===state.phase},attachAsap=function(e,t){var n;return n=function(){return attachNow(e,t)},isOpen()?chain.asap(closeNow,n):chain.asap(n),chain.promise()},attachNow=function(e,t){var n,r,o,i,a,s;return n=$(e),n.length||u.error("Cannot attach popup to non-existing element %o",e),t=u.options(t),s=u.option(u.pluckKey(t,"url"),n.attr("up-href"),n.attr("href")),o=u.option(u.pluckKey(t,"html")),a=u.option(u.pluckKey(t,"target"),n.attr("up-popup"),"body"),i=u.option(t.position,n.attr("up-position"),config.position),t.animation=u.option(t.animation,n.attr("up-animation"),config.openAnimation),t.sticky=u.option(t.sticky,u.castedAttr(n,"up-sticky"),config.sticky),t.history=up.browser.canPushState()?u.option(t.history,u.castedAttr(n,"up-history"),config.history):!1,t.confirm=u.option(t.confirm,n.attr("up-confirm")),t.method=up.link.followMethod(n,t),t.layer="popup",r=up.motion.animateOptions(t,n,{duration:config.openDuration,easing:config.openEasing
|
3
|
-
}),up.browser.whenConfirmed(t).then(function(){return up.bus.whenEmitted("up:popup:open",{url:s,message:"Opening popup"}).then(function(){var e,l;return state.phase="opening",state.$anchor=n,state.position=i,state.coveredUrl=up.browser.url(),state.coveredTitle=document.title,state.sticky=t.sticky,t.beforeSwap=function(){return createFrame(a)},e=u.merge(t,{animation:!1}),l=o?up.extract(a,o,e):up.replace(a,s,e),l=l.then(function(){return align(),up.animate(state.$popup,t.animation,r)}),l=l.then(function(){return state.phase="opened",up.emit("up:popup:opened",{message:"Popup opened"})})})})},closeAsap=function(e){return isOpen()&&chain.asap(function(){return closeNow(e)}),chain.promise()},closeNow=function(e){var t;return isOpen()?(e=u.options(e,{animation:config.closeAnimation,url:state.coveredUrl,title:state.coveredTitle}),t=up.motion.animateOptions(e,{duration:config.closeDuration,easing:config.closeEasing}),u.extend(e,t),up.bus.whenEmitted("up:popup:close",{message:"Closing popup",$element:state.$popup}).then(function(){return state.phase="closing",state.url=null,state.coveredUrl=null,state.coveredTitle=null,up.destroy(state.$popup,e).then(function(){return state.phase="closed",state.$popup=null,state.$anchor=null,state.sticky=null,up.emit("up:popup:closed",{message:"Popup closed"})})})):u.resolvedPromise()},autoclose=function(){return state.sticky?void 0:(discardHistory(),closeAsap())},contains=function(e){var t;return t=$(e),t.closest(".up-popup").length>0},up.link.onAction("[up-popup]",function(e){return e.is(".up-current")?closeAsap():attachAsap(e)}),up.on("mousedown","body",function(e,t){var n;return n=$(e.target),n.closest(".up-popup, [up-popup]").length?void 0:closeAsap()}),up.on("up:fragment:inserted",function(e,t){var n;if(contains(t)){if(n=t.attr("up-source"))return state.url=n}else if(contains(e.origin))return autoclose()}),up.bus.onEscape(closeAsap),up.on("click","[up-close]",function(e,t){return contains(t)?(closeAsap(),e.preventDefault()):void 0}),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),attach:attachAsap,close:closeAsap,url:function(){return state.url},coveredUrl:function(){return state.coveredUrl},config:config,contains:contains,isOpen:isOpen}}(jQuery)}.call(this),function(){up.modal=function($){var animate,autoclose,chain,closeAsap,closeNow,config,contains,createFrame,discardHistory,extractAsap,flavor,flavorDefault,flavorOverrides,followAsap,isOpen,markAsAnimating,openAsap,openNow,reset,shiftElements,state,templateHtml,u,unshiftElements,visitAsap;return u=up.util,config=u.config({maxWidth:null,minWidth:null,width:null,height:null,history:!0,openAnimation:"fade-in",closeAnimation:"fade-out",openDuration:null,closeDuration:null,openEasing:null,closeEasing:null,backdropOpenAnimation:"fade-in",backdropCloseAnimation:"fade-out",closeLabel:"\xd7",flavors:{"default":{}},template:function(e){return'<div class="up-modal">\n <div class="up-modal-backdrop"></div>\n <div class="up-modal-viewport">\n <div class="up-modal-dialog">\n <div class="up-modal-content"></div>\n <div class="up-modal-close" up-close>'+flavorDefault("closeLabel")+"</div>\n </div>\n </div>\n</div>"}}),state=u.config(function(){return{phase:"closed",$anchor:null,$modal:null,sticky:null,flavor:null,url:null,coveredUrl:null,coveredTitle:null,unshifters:[]}}),chain=new u.DivertibleChain,reset=function(){var e;return null!=(e=state.$modal)&&e.remove(),unshiftElements(),state.reset(),chain.reset(),config.reset()},templateHtml=function(){var e;return e=flavorDefault("template"),u.isFunction(e)?e(config):e},discardHistory=function(){return state.coveredTitle=null,state.coveredUrl=null},createFrame=function(e,t){var n,r,o;return o=$(templateHtml()),o.attr("up-flavor",state.flavor),r=o.find(".up-modal-dialog"),u.isPresent(t.width)&&r.css("width",t.width),u.isPresent(t.maxWidth)&&r.css("max-width",t.maxWidth),u.isPresent(t.height)&&r.css("height",t.height),n=o.find(".up-modal-content"),u.$createPlaceholder(e,n),o.appendTo(document.body),state.$modal=o},shiftElements=function(){var e,t,n,r,o;return u.documentHasVerticalScrollbar()?(e=$("body"),r=u.scrollbarWidth(),t=parseInt(e.css("padding-right")),n=r+t,o=u.temporaryCss(e,{"padding-right":n+"px","overflow-y":"hidden"}),state.unshifters.push(o),up.layout.anchoredRight().each(function(){var e,t,n,o;return e=$(this),t=parseInt(e.css("right")),n=r+t,o=u.temporaryCss(e,{right:n}),state.unshifters.push(o)})):void 0},unshiftElements=function(){var e,t;for(e=[];t=state.unshifters.pop();)e.push(t());return e},isOpen=function(){return"opened"===state.phase||"opening"===state.phase},followAsap=function(e,t){return t=u.options(t),t.$link=$(e),openAsap(t)},visitAsap=function(e,t){return t=u.options(t),t.url=e,openAsap(t)},extractAsap=function(e,t,n){return n=u.options(n),n.html=t,n.history=u.option(n.history,!1),n.target=e,openAsap(n)},openAsap=function(e){var t;return t=function(){return openNow(e)},isOpen()?chain.asap(closeNow,t):chain.asap(t),chain.promise()},openNow=function(e){var t,n,r,o,i;return e=u.options(e),t=u.option(u.pluckKey(e,"$link"),u.nullJQuery()),i=u.option(u.pluckKey(e,"url"),t.attr("up-href"),t.attr("href")),r=u.option(u.pluckKey(e,"html")),o=u.option(u.pluckKey(e,"target"),t.attr("up-modal"),"body"),e.flavor=u.option(e.flavor,t.attr("up-flavor")),e.width=u.option(e.width,t.attr("up-width"),flavorDefault("width",e.flavor)),e.maxWidth=u.option(e.maxWidth,t.attr("up-max-width"),flavorDefault("maxWidth",e.flavor)),e.height=u.option(e.height,t.attr("up-height"),flavorDefault("height")),e.animation=u.option(e.animation,t.attr("up-animation"),flavorDefault("openAnimation",e.flavor)),e.backdropAnimation=u.option(e.backdropAnimation,t.attr("up-backdrop-animation"),flavorDefault("backdropOpenAnimation",e.flavor)),e.sticky=u.option(e.sticky,u.castedAttr(t,"up-sticky"),flavorDefault("sticky",e.flavor)),e.confirm=u.option(e.confirm,t.attr("up-confirm")),e.method=up.link.followMethod(t,e),e.layer="modal",n=up.motion.animateOptions(e,t,{duration:flavorDefault("openDuration",e.flavor),easing:flavorDefault("openEasing",e.flavor)}),e.history=u.option(e.history,u.castedAttr(t,"up-history"),flavorDefault("history",e.flavor)),up.browser.canPushState()||(e.history=!1),up.browser.whenConfirmed(e).then(function(){return up.bus.whenEmitted("up:modal:open",{url:i,message:"Opening modal"}).then(function(){var t,a;return state.phase="opening",state.flavor=e.flavor,state.sticky=e.sticky,state.coveredUrl=up.browser.url(),state.coveredTitle=document.title,e.beforeSwap=function(){return createFrame(o,e)},t=u.merge(e,{animation:!1}),a=r?up.extract(o,r,t):up.replace(o,i,t),a=a.then(function(){return shiftElements(),animate(e.animation,e.backdropAnimation,n)}),a=a.then(function(){return state.phase="opened",up.emit("up:modal:opened",{message:"Modal opened"})})})})},closeAsap=function(e){return isOpen()&&chain.asap(function(){return closeNow(e)}),chain.promise()},closeNow=function(e){var t,n,r,o;return isOpen()?(e=u.options(e),o=u.option(e.animation,flavorDefault("closeAnimation")),n=u.option(e.backdropAnimation,flavorDefault("backdropCloseAnimation")),t=up.motion.animateOptions(e,{duration:flavorDefault("closeDuration"),easing:flavorDefault("closeEasing")}),r=u.options(u.except(e,"animation","duration","easing","delay"),{url:state.coveredUrl,title:state.coveredTitle}),up.bus.whenEmitted("up:modal:close",{$element:state.$modal,message:"Closing modal"}).then(function(){var e;return state.phase="closing",state.url=null,state.coveredUrl=null,state.coveredTitle=null,e=animate(o,n,t),e=e.then(function(){return up.destroy(state.$modal,r)}),e=e.then(function(){return unshiftElements(),state.phase="closed",state.$modal=null,state.flavor=null,state.sticky=null,up.emit("up:modal:closed",{message:"Modal closed"})})})):u.resolvedPromise()},markAsAnimating=function(e){return null==e&&(e=!0),state.$modal.toggleClass("up-modal-animating",e)},animate=function(e,t,n){var r;return up.motion.isNone(e)?u.resolvedPromise():(markAsAnimating(),r=$.when(up.animate(state.$modal.find(".up-modal-viewport"),e,n),up.animate(state.$modal.find(".up-modal-backdrop"),t,n)),r=r.then(function(){return markAsAnimating(!1)}))},autoclose=function(){return state.sticky?void 0:(discardHistory(),closeAsap())},contains=function(e){var t;return t=$(e),t.closest(".up-modal").length>0},flavor=function(e,t){return null==t&&(t={}),u.extend(flavorOverrides(e),t)},flavorOverrides=function(e){var t;return(t=config.flavors)[e]||(t[e]={})},flavorDefault=function(e,t){var n;return null==t&&(t=state.flavor),t&&(n=flavorOverrides(t)[e]),u.isMissing(n)&&(n=config[e]),n},up.link.onAction("[up-modal]",function(e){return followAsap(e)}),up.on("click","body",function(e,t){var n;return n=$(e.target),n.closest(".up-modal-dialog").length||n.closest("[up-modal]").length?void 0:closeAsap()}),up.on("up:fragment:inserted",function(e,t){var n;if(contains(t)){if(n=t.attr("up-source"))return state.url=n}else if(contains(e.origin)&&!up.popup.contains(t))return autoclose()}),up.bus.onEscape(closeAsap),up.on("click","[up-close]",function(e,t){return contains(t)?(closeAsap(),e.preventDefault()):void 0}),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),visit:visitAsap,follow:followAsap,extract:extractAsap,close:closeAsap,url:function(){return state.url},coveredUrl:function(){return state.coveredUrl},config:config,contains:contains,isOpen:isOpen,flavor:flavor}}(jQuery)}.call(this),function(){up.tooltip=function(e){var t,n,r,o,i,u,a,s,l,c,p,f;return f=up.util,a=f.config({position:"top",openAnimation:"fade-in",closeAnimation:"fade-out",openDuration:100,closeDuration:50,openEasing:null,closeEasing:null}),p=f.config({phase:"closed",$anchor:null,$tooltip:null,position:null}),o=new f.DivertibleChain,c=function(){var e;return null!=(e=p.$tooltip)&&e.remove(),p.reset(),o.reset(),a.reset()},t=function(){var e,t,n;switch(e={},n=f.measure(p.$tooltip),f.isFixed(p.$anchor)?(t=p.$anchor.get(0).getBoundingClientRect(),e.position="fixed"):t=f.measure(p.$anchor),p.position){case"top":e.top=t.top-n.height,e.left=t.left+.5*(t.width-n.width);break;case"left":e.top=t.top+.5*(t.height-n.height),e.left=t.left-n.width;break;case"right":e.top=t.top+.5*(t.height-n.height),e.left=t.left+t.width;break;case"bottom":e.top=t.top+t.height,e.left=t.left+.5*(t.width-n.width);break;default:f.error("Unknown position option '%s'",p.position)}return p.$tooltip.attr("up-position",p.position),p.$tooltip.css(e)},s=function(e){var t;return t=f.$createElementFromSelector(".up-tooltip"),f.isGiven(e.text)?t.text(e.text):t.html(e.html),t.appendTo(document.body),p.$tooltip=t},n=function(e,t){var n;return null==t&&(t={}),n=function(){return r(e,t)},l()?o.asap(u,n):o.asap(n),o.promise()},r=function(n,r){var o,i,u,l,c,d;return o=e(n),r=f.options(r),l=f.option(r.html,o.attr("up-tooltip-html")),d=f.option(r.text,o.attr("up-tooltip")),c=f.option(r.position,o.attr("up-position"),a.position),u=f.option(r.animation,f.castedAttr(o,"up-animation"),a.openAnimation),i=up.motion.animateOptions(r,o,{duration:a.openDuration,easing:a.openEasing}),p.phase="opening",p.$anchor=o,s({text:d,html:l}),p.position=c,t(),up.animate(p.$tooltip,u,i).then(function(){return p.phase="opened"})},i=function(e){return l()&&o.asap(function(){return u(e)}),o.promise()},u=function(e){var t;return l()?(e=f.options(e,{animation:a.closeAnimation}),t=up.motion.animateOptions(e,{duration:a.closeDuration,easing:a.closeEasing}),f.extend(e,t),p.phase="closing",up.destroy(p.$tooltip,e).then(function(){return p.phase="closed",p.$tooltip=null,p.$anchor=null})):f.resolvedPromise()},l=function(){return"opening"===p.phase||"opened"===p.phase},up.compiler("[up-tooltip], [up-tooltip-html]",function(e){return e.on("mouseenter",function(){return n(e)}),e.on("mouseleave",function(){return i()})}),up.on("click","body",function(e,t){return i()}),up.on("up:framework:reset",c),up.bus.onEscape(function(){return i()}),{config:a,attach:n,isOpen:l,close:i}}(jQuery)}.call(this),function(){var e=[].slice;up.navigation=function(t){var n,r,o,i,u,a,s,l,c,p,f,d,m,h;return f=up.util,o=f.config({currentClasses:["up-current"]}),c=function(){return o.reset()},i=function(){var e;return e=o.currentClasses,e=e.concat(["up-current"]),e=f.uniq(e),e.join(" ")},n="up-active",r="a, [up-href]",l=function(e){return f.isPresent(e)?f.normalizeUrl(e):void 0},p=function(e){var t,n,r,o,i,u,a,s,c,p;for(s=[],u=["href","up-href","up-alias"],n=0,o=u.length;o>n;n++)if(t=u[n],c=f.presentAttr(e,t))for(p="up-alias"===t?c.split(" "):[c],r=0,i=p.length;i>r;r++)a=p[r],"#"!==a&&(a=l(a),s.push(a));return s},m=function(e){var t,n,r,o;return e=f.compact(e),r=function(e){return"*"===e.substr(-1)?n(e.slice(0,-1)):t(e)},t=function(t){return f.contains(e,t)},n=function(t){return f.detect(e,function(e){return 0===e.indexOf(t)})},o=function(e){return f.detect(e,r)},{matchesAny:o}},a=function(){var e,n;return e=m([l(up.browser.url()),l(up.modal.url()),l(up.modal.coveredUrl()),l(up.popup.url()),l(up.popup.coveredUrl())]),n=i(),f.each(t(r),function(r){var o,i;return o=t(r),i=p(o),e.matchesAny(i)?o.addClass(n):o.hasClass(n)&&0===o.closest(".up-destroying").length?o.removeClass(n):void 0})},u=function(e,n){var o;return o=t(e),n=f.options(n,{enlarge:!1}),n.enlarge?f.presence(o.parent(r))||o:o},s=function(e,t){var r;return r=u(e,t),r.addClass(n)},d=function(e,t){var r;return r=u(e,t),r.removeClass(n)},h=function(){var n,r,o,i,u,a;return i=arguments[0],r=2<=arguments.length?e.call(arguments,1):[],o=r.pop(),u=f.options(r.pop()),n=t(i),s(n,u),a=o(),f.isPromise(a)?a.always(function(){return d(n,u)}):up.warn("Expected block to return a promise, but got %o",a),a},up.on("up:fragment:inserted",function(){return a()}),up.on("up:fragment:destroyed",function(e,t){return t.is(".up-modal, .up-popup")?a():void 0}),up.on("up:framework:reset",c),{config:o,defaults:function(){return f.error("up.navigation.defaults(...) no longer exists. Set values on he up.navigation.config property instead.")},markActive:s,unmarkActive:d,withActiveMark:h}}(jQuery)}.call(this),function(){up.rails=function(e){var t,n,r,o;return r=up.util,o=function(e){return e.is("[up-follow], [up-target], [up-modal], [up-popup]")},n=function(){return r.isGiven(e.rails)},r.each(["method","confirm"],function(e){var t,i;return t="data-"+e,i="up-"+e,up.compiler("["+t+"]",function(e){var u;return n()&&o(e)?(u={},u[i]=e.attr(t),r.setMissingAttrs(e,u),e.removeAttr(t)):void 0})}),t=function(){return n()?{name:e.rails.csrfParam(),value:e.rails.csrfToken()}:void 0},{csrfField:t,isRails:n}}(jQuery)}.call(this),function(){up.boot()}.call(this);
|
1
|
+
(function(){window.up={version:"0.27.3"}}).call(this),function(){var e=[].slice,t=function(e,t){return function(){return e.apply(t,arguments)}};up.util=function(n){var r,o,i,u,a,s,l,c,p,f,d,m,h,v,g,y,b,w,k,S,x,A,$,D,T,E,C,P,O,F,U,R,_,M,N,j,I,K,L,q,z,W,H,Q,V,J,B,X,G,Y,Z,et,tt,nt,rt,ot,it,ut,at,st,lt,ct,pt,ft,dt,mt,ht,vt,gt,yt,bt,wt,kt,St,xt,At,$t,Dt,Tt,Et,Ct,Pt,Ot,Ft,Ut,Rt,_t,Mt,Nt,jt,It,Kt,Lt,qt,zt,Wt,Ht,Qt,Vt,Jt,Bt,Xt,Gt,Yt,Zt,en,tn,nn;return gt=n.noop,pt=function(t){var n,r;return n=void 0,r=!1,function(){var o;return o=1<=arguments.length?e.call(arguments,0):[],r?n:(r=!0,n=t.apply(null,o))}},nt=function(e,t){return t=t.toString(),(""===t||"80"===t)&&"http:"===e||"443"===t&&"https:"===e},bt=function(e,t){var n,r,o;return n=Tt(e),r=n.protocol+"//"+n.hostname,nt(n.protocol,n.port)||(r+=":"+n.port),o=n.pathname,"/"!==o[0]&&(o="/"+o),(null!=t?t.stripTrailingSlash:void 0)!==!1&&(o=o.replace(/\/$/,"")),r+=o,(null!=t?t.hash:void 0)===!0&&(r+=n.hash),(null!=t?t.search:void 0)!==!1&&(r+=n.search),r},Tt=function(e){var t;return t=null,rt(e)?(t=n("<a>").attr({href:e}).get(0),I(t.hostname)&&(t.href=t.href)):t=Gt(e),t},yt=function(e){return e?e.toUpperCase():"GET"},r=function(e){var t,r,o,i,u,a,s,l,c,p,f,d,m,h,v,g;for(v=e.split(/[ >]/),o=null,f=c=0,m=v.length;m>c;f=++c){for(a=v[f],u=a.match(/(^|\.|\#)[A-Za-z0-9\-_]+/g),g="div",i=[],p=null,d=0,h=u.length;h>d;d++)switch(s=u[d],s[0]){case".":i.push(s.substr(1));break;case"#":p=s.substr(1);break;default:g=s}l="<"+g,i.length&&(l+=' class="'+i.join(" ")+'"'),p&&(l+=' id="'+p+'"'),l+=">",t=n(l),r&&t.appendTo(r),0===f&&(o=t),r=t}return o},b=function(e,t){var n;return n=document.createElement(e),et(t)&&(n.innerHTML=t),n},o=function(e,t){var n;return null==t&&(t=document.body),n=r(e),n.addClass("up-placeholder"),n.appendTo(t),n},zt=function(e){var t,r,o,i,u,a,s,l,c;if(t=n(e),l=void 0,up.puts("Creating selector from element %o",t.get(0)),c=Pt(t.attr("up-id")))l="[up-id='"+c+"']";else if(i=Pt(t.attr("id")))l="#"+i;else if(s=Pt(t.attr("name")))l="[name='"+s+"']";else if(r=Pt(vt(t)))for(l="",o=0,a=r.length;a>o;o++)u=r[o],l+="."+u;else l=t.prop("tagName").toLowerCase();return l},vt=function(e){var t,n;return t=e.attr("class")||"",n=t.split(" "),qt(n,function(e){return et(e)&&!e.match(/^up-/)})},w=function(e){var t,n,r,o,i,u,a,s,l,c,p,f;return l=function(e){return"<"+e+"(?: [^>]*)?>"},u=function(e){return"</"+e+">"},t="(?:.|\\s)*?",i=function(e){return"("+e+")"},f=new RegExp(l("head")+t+l("title")+i(t)+u("title")+t+u("body"),"i"),o=new RegExp(l("body")+i(t)+u("body"),"i"),(r=e.match(o))?(s=document.createElement("html"),n=b("body",r[1]),s.appendChild(n),(p=e.match(f))&&(a=b("head"),s.appendChild(a),c=b("title",p[1]),a.appendChild(c)),s):b("div",e)},C=n.extend,Xt=n.trim,A=function(e,t){var n,r,o,i,u;for(u=[],r=n=0,i=e.length;i>n;r=++n)o=e[r],u.push(t(o,r));return u},lt=A,Vt=function(e,t){var n,r,o,i;for(i=[],r=n=0,o=e-1;o>=0?o>=n:n>=o;r=o>=0?++n:--n)i.push(t(r));return i},G=function(e){return null===e},ot=function(e){return void 0===e},L=function(e){return!ot(e)},X=function(e){return ot(e)||G(e)},V=function(e){return!X(e)},I=function(e){return X(e)||Z(e)&&0===Object.keys(e).length||0===e.length},Pt=function(e,t){return null==t&&(t=et),t(e)?e:void 0},et=function(e){return!I(e)},Q=function(e){return"function"==typeof e},rt=function(e){return"string"==typeof e},Y=function(e){return"number"==typeof e},J=function(e){return"object"==typeof e&&!!e},Z=function(e){return J(e)||"function"==typeof e},z=function(e){return!(!e||1!==e.nodeType)},B=function(e){return e instanceof jQuery},tt=function(e){return Z(e)&&Q(e.then)},K=function(e){return tt(e)&&Q(e.resolve)},j=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},H=function(e){return up.browser.canFormData()&&e instanceof FormData},Bt=function(e){return Array.prototype.slice.call(e)},g=function(e){return j(e)?e.slice():J(e)?C({},e):void 0},Gt=function(e){return B(e)?e.get(0):e},ft=function(){var t;return t=1<=arguments.length?e.call(arguments,0):[],C.apply(null,[{}].concat(e.call(t)))},Dt=function(e,t){var n,r,o,i;if(o=e?g(e):{},t)for(r in t)n=t[r],i=o[r],V(i)?Z(n)&&Z(i)&&(o[r]=Dt(i,n)):o[r]=n;return o},$t=function(){var t;return t=1<=arguments.length?e.call(arguments,0):[],S(t,V)},S=function(e,t){var n,r,o,i;for(i=void 0,r=0,o=e.length;o>r;r++)if(n=e[r],t(n)){i=n;break}return i},l=function(e,t){var n,r,o,i;for(i=!1,r=0,o=e.length;o>r;r++)if(n=e[r],t(n)){i=!0;break}return i},s=function(e,t){var n,r,o,i;for(i=!0,r=0,o=e.length;o>r;r++)if(n=e[r],!t(n)){i=!1;break}return i},m=function(e){return qt(e,V)},Yt=function(e){var t;return t={},qt(e,function(e){return t.hasOwnProperty(e)?!1:t[e]=!0})},qt=function(e,t){var n;return n=[],A(e,function(e){return t(e)?n.push(e):void 0}),n},Ut=function(e,t){return qt(e,function(e){return!t(e)})},N=function(e,t){return qt(e,function(e){return v(t,e)})},Ot=function(){var t,n,r,o;return t=arguments[0],r=2<=arguments.length?e.call(arguments,1):[],o=function(){var e,o,i;for(i=[],e=0,o=r.length;o>e;e++)n=r[e],i.push(t.attr(n));return i}(),S(o,et)},Ht=function(e,t){return e>0?setTimeout(t,e):t()},ht=function(e){return setTimeout(e,0)},at=function(e){return e[e.length-1]},d=function(){var e;return e=document.documentElement,{width:e.clientWidth,height:e.clientHeight}},Lt=pt(function(){var e,t,r;return e=n("<div>"),e.attr("up-viewport",""),e.css({position:"absolute",top:"0",left:"0",width:"50px",height:"50px",overflowY:"scroll"}),e.appendTo(document.body),t=e.get(0),r=t.offsetWidth-t.clientWidth,e.remove(),r}),x=function(){var e,t,r,o,i,u;return t=document.body,e=n(t),u=document.documentElement,r=e.css("overflow-y"),i="scroll"===r,o="hidden"===r,i||!o&&u.scrollHeight>u.clientHeight},St=function(t){var n;return n=void 0,function(){var r;return r=1<=arguments.length?e.call(arguments,0):[],null!=t&&(n=t.apply(null,r)),t=void 0,n}},Qt=function(e,t,r){var o,i,u;return o=n(e),u=o.css(Object.keys(t)),o.css(t),i=function(){return o.css(u)},r?(r(),i()):St(i)},R=function(e){var t,n;return n=e.css(["transform","-webkit-transform"]),I(n)||"none"===n.transform?(t=function(){return e.css(n)},e.css({transform:"translateZ(0)","-webkit-transform":"translateZ(0)"})):t=function(){},t},_=function(e){return e=Gt(e),e.offsetHeight},k=function(e,t,r){var o,u,a,s,l,c,p,f;return o=n(e),r=Dt(r,{duration:300,delay:0,easing:"ease"}),0===r.duration?(o.css(t),It()):(u=n.Deferred(),p=Object.keys(t),l={"transition-property":p.join(", "),"transition-duration":r.duration+"ms","transition-delay":r.delay+"ms","transition-timing-function":r.easing},a=o.css(Object.keys(l)),o.addClass("up-animating"),c=function(){return o.removeClass("up-animating"),o.off("transitionend",s)},s=function(e){var t;return t=e.originalEvent.propertyName,v(p,t)?(u.resolve(),c()):void 0},o.on("transitionend",s),u.then(c),f=R(o),o.css(l),o.css(t),o.data(i,u),u.then(function(){var e;return o.removeData(i),f(),o.css({transition:"none"}),e=!("none"===a["transition-property"]||"all"===a["transition-property"]&&"0"===a["transition-duration"][0]),e?(_(o),o.css(a)):void 0}),u)},i="up-animation-deferred",F=function(e){return n(e).each(function(){var e;return(e=Et(this,i))?e.resolve():void 0})},ct=function(e,t){var r,o,i,u,a;return t=Dt(t,{relative:!1,inner:!1}),t.relative?t.relative===!0?u=e.position():(r=n(t.relative),a=e.offset(),r.is(document)?u=a:(i=r.offset(),u={left:a.left-i.left,top:a.top-i.top})):u=e.offset(),o={left:u.left,top:u.top},t.inner?(o.width=e.width(),o.height=e.height()):(o.width=e.outerWidth(),o.height=e.outerHeight()),o},y=function(e,t){var n,r,o,i,u;for(i=e.get(0).attributes,u=[],r=0,o=i.length;o>r;r++)n=i[r],u.push(n.specified?t.attr(n.name,n.value):void 0);return u},O=function(e,t){return e.find(t).addBack(t)},T=function(e){return 27===e.keyCode},v=function(e,t){return e.indexOf(t)>=0},f=function(e,t){var n;switch(n=e.attr(t)){case"false":return!1;case"true":return!0;case"":return!0;default:return n}},st=function(e){return e.getResponseHeader("X-Up-Location")},Jt=function(e){return e.getResponseHeader("X-Up-Title")},dt=function(e){return e.getResponseHeader("X-Up-Method")},xt=function(){var t,n,r,o,i,u;for(o=arguments[0],i=2<=arguments.length?e.call(arguments,1):[],t={},n=0,r=i.length;r>n;n++)u=i[n],o.hasOwnProperty(u)&&(t[u]=o[u]);return t},E=function(){var t,n,r,o,i,u;for(o=arguments[0],i=2<=arguments.length?e.call(arguments,1):[],t=g(o),n=0,r=i.length;r>n;n++)u=i[n],delete t[u];return t},it=function(e){return!(e.metaKey||e.shiftKey||e.ctrlKey)},ut=function(e){var t;return t=ot(e.button)||0===e.button,t&&it(e)},It=function(){var e;return e=n.Deferred(),e.resolve(),e},Kt=function(){return It().promise()},Zt=function(){return n.Deferred()},en=function(){return Zt().promise()},wt=function(){return n()},jt=function(){var t,r;return t=1<=arguments.length?e.call(arguments,0):[],r=n.when.apply(n,[It()].concat(e.call(t))),r.resolve=pt(function(){return A(t,function(e){return e.resolve()})}),r},Wt=function(e,t){var n,r,o;r=[];for(n in t)o=t[n],r.push(X(e.attr(n))?e.attr(n,o):void 0);return r},Rt=function(e,t){var n;return n=e.indexOf(t),n>=0?(e.splice(n,1),t):void 0},mt=function(e){var t,r,o,i,u,a,s;for(u={},s=[],r=[],o=0,i=e.length;i>o;o++)a=e[o],rt(a)?s.push(a):r.push(a);return u.parsed=r,s.length&&(t=s.join(", "),u.parsed.push(t)),u.select=function(){return u.find(void 0)},u.find=function(e){var t,r,o,i,a,s;for(r=wt(),a=u.parsed,o=0,i=a.length;i>o;o++)s=a[o],t=e?e.find(s):n(s),r=r.add(t);return r},u.findWithSelf=function(e){var t;return t=u.find(e),u.doesMatch(e)&&(t=t.add(e)),t},u.doesMatch=function(e){var t;return t=n(e),l(u.parsed,function(e){return t.is(e)})},u.seekUp=function(e){var t,r,o;for(o=n(e),t=o,r=void 0;t.length;){if(u.doesMatch(t)){r=t;break}t=t.parent()}return r||wt()},u},p=function(t){var n,r,o,i,u,a,s,l,c,p,f,d,m,h,v;return null==t&&(t={}),h=void 0,d=function(e){return function(){var n;return n=t[e],Y(n)?n:Q(n)?n():void 0}},p=d("size"),o=d("expiry"),f=function(e){return t.key?t.key(e):e.toString()},u=function(){return 0!==p()&&0!==o()},r=function(){return h={}},r(),l=function(){var n;return n=1<=arguments.length?e.call(arguments,0):[],t.logPrefix?(n[0]="["+t.logPrefix+"] "+n[0],up.puts.apply(up,n)):void 0},s=function(){return Object.keys(h)},c=function(){var e,t,n,r;return r=g(s()),e=p(),e&&r.length>=e&&(t=null,n=null,A(r,function(e){var r,o;return r=h[e],o=r.timestamp,!n||n>o?(t=e,n=o):void 0}),t)?delete h[t]:void 0},n=function(e,t){var n;return n=i(e,{silent:!0}),L(n)?m(t,n):void 0},v=function(){return(new Date).valueOf()},m=function(e,t){var n;return u()?(c(),n=f(e),h[n]={timestamp:v(),value:t}):void 0},Rt=function(e){var t;return t=f(e),delete h[t]},a=function(e){var t,n;return t=o(),t?(n=v()-e.timestamp,t>n):!0},i=function(e,t){var n,r;return null==t&&(t={}),r=f(e),(n=h[r])?a(n)?(t.silent||l("Cache hit for '%s'",e),n.value):(t.silent||l("Discarding stale cache entry for '%s'",e),void Rt(e)):void(t.silent||l("Cache miss for '%s'",e))},{alias:n,get:i,set:m,remove:Rt,clear:r,keys:s}},h=function(e){var t;return null==e&&(e={}),t={},t.reset=function(){var n;return n=e,Q(n)&&(n=n()),C(t,n)},t.reset(),Object.preventExtensions(t),t},tn=function(e){var t,n;return e=Gt(e),t=e.parentNode,n=Bt(e.childNodes),A(n,function(n){return t.insertBefore(n,e)}),t.removeChild(e)},kt=function(e){var t,n;for(t=void 0;(e=e.parent())&&e.length;)if(n=e.css("position"),"absolute"===n||"relative"===n||e.is("body")){t=e;break}return t},W=function(e){var t,r;for(t=n(e);;){if(r=t.css("position"),"fixed"===r)return!0;if(t=t.parent(),0===t.length||t.is(document))return!1}},U=function(e,t){var r,o,i,u;return r=n(e),o=kt(r),i=r.position(),u=o.offset(),r.css({position:"absolute",left:i.left-u.left,top:i.top-u.top+t.scrollTop(),right:"",bottom:""})},_t=function(e){var t,n,r,o,i,u,a;if(H(e))return up.error("Cannot convert FormData into an array");for(u=Mt(e),t=[],a=u.split("&"),n=0,r=a.length;r>n;n++)i=a[n],et(i)&&(o=i.split("="),t.push({name:decodeURIComponent(o[0]),value:decodeURIComponent(o[1])}));return t},Mt=function(e){var t;return H(e)?up.error("Cannot convert FormData into a query string"):et(e)?(t=n.param(e),t=t.replace(/\+/g,"%20")):""},Nt=function(e){var t,r;return t=n(e),r=t.find("input[type=file]").length,r&&up.browser.canFormData()?new FormData(t.get(0)):t.serializeArray()},c=function(e,t,n){var r;return H(e)?e.append(t,n):j(e)?e.push({name:t,value:n}):Z(e)?e[t]=n:(rt(e)||X(e))&&(r=Mt([{name:t,value:n}]),e=et(e)?[e,r].join("&"):r),e},$=function(){var t,r,o,i;throw t=1<=arguments.length?e.call(arguments,0):[],(o=up.log).error.apply(o,t),nn().then(function(){var r,o,i,u;return r=Pt(n(".up-error"))||n('<div class="up-error"></div>').prependTo("body"),i=function(e){return"<span class='up-error-variable'>"+D(e)+"</span>"},o=(u=up.browser).sprintfWithFormattedArgs.apply(u,[i].concat(e.call(t))),r.html(o)}),r=(i=up.browser).sprintf.apply(i,t),new Error(r)},a={"&":"&","<":"<",">":">",'"':"""},D=function(e){return e.replace(/[&<>"]/g,function(e){return a[e]})},Ct=function(e,t){var n;return n=e[t],delete e[t],n},Et=function(e,t){var r,o;return r=n(e),o=r.data(t),r.removeData(t),o},P=function(e){var t;return t=at(e),J(t)&&!B(t)?e.pop():{}},At=function(e){var t;return t=n(e).css("opacity"),V(t)?parseFloat(t):void 0},nn=pt(function(){var e;return n.isReady?Kt():(e=n.Deferred(),n(function(){return e.resolve()}),e.promise())}),M=function(e){return e},q=function(e){return e=Gt(e),!jQuery.contains(document.documentElement,e)},Ft=function(t){var r,o;return r=n.Deferred(),o=function(){var n;return n=1<=arguments.length?e.call(arguments,0):[],t.apply(null,n).then(function(){return r.resolve()})},o.promise=r.promise(),o},u=function(){function r(){this.asap=t(this.asap,this),this.poke=t(this.poke,this),this.allTasks=t(this.allTasks,this),this.promise=t(this.promise,this),this.reset=t(this.reset,this),this.reset()}return r.prototype.reset=function(){return this.queue=[],this.currentTask=void 0},r.prototype.promise=function(){var e;return e=lt(this.allTasks(),function(e){return e.promise}),n.when.apply(n,e)},r.prototype.allTasks=function(){var e;return e=[],this.currentTask&&e.push(this.currentTask),e=e.concat(this.queue)},r.prototype.poke=function(){var e;return!this.currentTask&&(this.currentTask=this.queue.shift())?(e=this.currentTask(),e.always(function(e){return function(){return e.currentTask=void 0,e.poke()}}(this))):void 0},r.prototype.asap=function(){var t;return t=1<=arguments.length?e.call(arguments,0):[],this.queue=lt(t,Ft),this.poke()},r}(),{isDetached:q,requestDataAsArray:_t,requestDataAsQuery:Mt,appendRequestData:c,requestDataFromForm:Nt,offsetParent:kt,fixedToAbsolute:U,isFixed:W,presentAttr:Ot,createElement:b,parseUrl:Tt,normalizeUrl:bt,normalizeMethod:yt,createElementFromHtml:w,$createElementFromSelector:r,$createPlaceholder:o,selectorForElement:zt,extend:C,copy:g,merge:ft,options:Dt,option:$t,error:$,each:A,map:lt,times:Vt,any:l,all:s,detect:S,select:qt,reject:Ut,intersect:N,compact:m,uniq:Yt,last:at,isNull:G,isDefined:L,isUndefined:ot,isGiven:V,isMissing:X,isPresent:et,isBlank:I,presence:Pt,isObject:Z,isFunction:Q,isString:rt,isNumber:Y,isElement:z,isJQuery:B,isPromise:tt,isDeferred:K,isHash:J,isArray:j,isFormData:H,isUnmodifiedKeyEvent:it,isUnmodifiedMouseEvent:ut,nullJQuery:wt,unJQuery:Gt,setTimer:Ht,nextFrame:ht,measure:ct,temporaryCss:Qt,cssAnimate:k,finishCssAnimate:F,forceCompositing:R,forceRepaint:_,escapePressed:T,copyAttributes:y,findWithSelf:O,contains:v,toArray:Bt,castedAttr:f,locationFromXhr:st,titleFromXhr:Jt,methodFromXhr:dt,clientSize:d,only:xt,except:E,trim:Xt,unresolvableDeferred:Zt,unresolvablePromise:en,resolvedPromise:Kt,resolvedDeferred:It,resolvableWhen:jt,setMissingAttrs:Wt,remove:Rt,memoize:pt,scrollbarWidth:Lt,documentHasVerticalScrollbar:x,config:h,cache:p,unwrapElement:tn,multiSelector:mt,error:$,pluckData:Et,pluckKey:Ct,extractOptions:P,isDetached:q,noop:gt,opacity:At,whenReady:nn,identity:M,escapeHtml:D,DivertibleChain:u}}($),up.error=up.util.error}.call(this),function(){var e=[].slice;up.browser=function(t){var n,r,o,i,u,a,s,l,c,p,f,d,m,h,v,g,y,b,w,k,S,x;return k=up.util,m=function(e,n){var r,o,i,u,a;return null==n&&(n={}),u=k.option(n.method,"get").toLowerCase(),"get"===u?(a=k.requestDataAsQuery(n.data),a&&(e=e+"?"+a),location.href=e):(r=t("<form method='post' action='"+e+"'></form>"),o=function(e){var n;return n=t('<input type="hidden">'),n.attr(e.name,e.value),n.appendTo(r)},o({name:up.proxy.config.wrapMethodParam,value:u}),(i=up.rails.csrfField())&&o(i),k.each(k.requestDataAsArray(n.data),o),r.hide().appendTo("body"),r.submit())},v=function(){var t,n,r;return r=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],u()?console[r].apply(console,t):(n=y.apply(null,t),console[r](n))},n=/\%[odisf]/g,w=function(e){var n,r,o,i,u,a,s,l,c;if(a=100,o="",k.isString(e))l=e.replace(/[\n\r\t ]+/g," "),l=l.replace(/^[\n\r\t ]+/,""),l=l.replace(/[\n\r\t ]$/,""),l='"'+l+'"',o='"';else if(k.isUndefined(e))l="undefined";else if(k.isNumber(e)||k.isFunction(e))l=e.toString();else if(k.isArray(e))l="["+k.map(e,w).join(", ")+"]",o="]";else if(k.isJQuery(e))l="$("+k.map(e,w).join(", ")+")",o=")";else if(k.isElement(e)){for(n=t(e),l="<"+e.tagName.toLowerCase(),s=["id","name","class"],i=0,u=s.length;u>i;i++)r=s[i],(c=n.attr(r))&&(l+=" "+r+'="'+c+'"');l+=">",o=">"}else l=JSON.stringify(e);return l.length>a&&(l=l.substr(0,a)+" \u2026",l+=o),l},y=function(){var t,n;return n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],b.apply(null,[k.identity,n].concat(e.call(t)))},b=function(){var t,r,o,i;return r=arguments[0],i=arguments[1],t=3<=arguments.length?e.call(arguments,2):[],k.isBlank(i)?"":(o=0,i.replace(n,function(){var e;return e=t[o],e=r(w(e)),o+=1,e}))},S=function(){return location.href},c=k.memoize(function(){return k.isUndefined(document.addEventListener)}),p=k.memoize(function(){return c()||-1!==navigator.appVersion.indexOf("MSIE 9.")}),a=k.memoize(function(){return k.isDefined(history.pushState)&&"get"===s()}),r=k.memoize(function(){return"transition"in document.documentElement.style}),i=k.memoize(function(){return"oninput"in document.createElement("input")}),o=k.memoize(function(){return!!window.FormData}),u=k.memoize(function(){return!p()}),f=k.memoize(function(){var e,n,r,o;return o=t.fn.jquery,r=o.split("."),e=parseInt(r[0]),n=parseInt(r[1]),e>=2||1===e&&n>=9}),h=function(e){var t,n;return n=null!=(t=document.cookie.match(new RegExp(e+"=(\\w+)")))?t[1]:void 0,k.isPresent(n)&&(document.cookie=e+"=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/"),n},x=function(e){return e.preload||k.isBlank(e.confirm)||window.confirm(e.confirm)?k.resolvedPromise():k.unresolvablePromise()},s=k.memoize(function(){return(h("_up_request_method")||"get").toLowerCase()}),d=function(){return!c()&&f()},l=function(){var t,n,r,o;for(null==window.console&&(window.console={}),o=["debug","info","warn","error","group","groupCollapsed","groupEnd"],t=0,n=o.length;n>t;t++)r=o[t],null==console[r]&&(console[r]=function(){var t;return t=1<=arguments.length?e.call(arguments,0):[],v.apply(null,["log"].concat(e.call(t)))});return null!=console.log?console.log:console.log=k.noop},g=k.memoize(function(){return window.sessionStorage||{getItem:k.noop,setItem:k.noop,removeItem:k.noop}}),{url:S,loadPage:m,whenConfirmed:x,canPushState:a,canCssTransition:r,canInputEvent:i,canFormData:o,canLogSubstitution:u,isSupported:d,installPolyfills:l,puts:v,sprintf:y,sprintfWithFormattedArgs:b,sessionStorage:g}}(jQuery)}.call(this),function(){var slice=[].slice;up.bus=function($){var boot,emit,emitReset,forgetUpDescription,live,liveUpDescriptions,logEmission,nextUpDescriptionNumber,nobodyPrevents,onEscape,rememberUpDescription,restoreSnapshot,snapshot,u,unbind,upDescriptionNumber,upDescriptionToJqueryDescription,upListenerToJqueryListener,whenEmitted;return u=up.util,liveUpDescriptions={},nextUpDescriptionNumber=0,upListenerToJqueryListener=function(e){return function(t){var n;return n=t.$element||$(this),e.apply(n.get(0),[t,n,up.syntax.data(n)])}},upDescriptionToJqueryDescription=function(e,t){var n,r,o;return n=u.copy(e),o=n.pop(),r=void 0,t?(r=upListenerToJqueryListener(o),o._asJqueryListener=r,o._descriptionNumber=++nextUpDescriptionNumber):(r=o._asJqueryListener,r||u.error("up.off: The event listener %o was never registered through up.on")),n.push(r),n},live=function(){var e,t,n;return n=1<=arguments.length?slice.call(arguments,0):[],up.browser.isSupported()?(e=upDescriptionToJqueryDescription(n,!0),rememberUpDescription(n),(t=$(document)).on.apply(t,e),function(){return unbind.apply(null,n)}):function(){}},unbind=function(){var e,t,n;return n=1<=arguments.length?slice.call(arguments,0):[],e=upDescriptionToJqueryDescription(n,!1),forgetUpDescription(n),(t=$(document)).off.apply(t,e)},rememberUpDescription=function(e){var t;return t=upDescriptionNumber(e),liveUpDescriptions[t]=e},forgetUpDescription=function(e){var t;return t=upDescriptionNumber(e),delete liveUpDescriptions[t]},upDescriptionNumber=function(e){return u.last(e)._descriptionNumber},emit=function(e,t){var n,r;return null==t&&(t={}),r=$.Event(e,t),(n=t.$element)?delete t.$element:n=$(document),logEmission(e,t),n.trigger(r),r},logEmission=function(e,t){var n,r,o;return t.hasOwnProperty("message")?(n=t.message,delete t.message,u.isArray(n)?(o=n,n=o[0],r=2<=o.length?slice.call(o,1):[]):r=[],n?u.isPresent(t)?up.puts.apply(up,[n+" (%s (%o))"].concat(slice.call(r),[e],[t])):up.puts.apply(up,[n+" (%s)"].concat(slice.call(r),[e])):void 0):u.isPresent(t)?up.puts("Emitted event %s (%o)",e,t):up.puts("Emitted event %s",e)},nobodyPrevents=function(){var e,t;return e=1<=arguments.length?slice.call(arguments,0):[],t=emit.apply(null,e),t.isDefaultPrevented()?(up.puts("An observer prevented the event %s",e[0]),!1):!0},whenEmitted=function(){var e,t;return e=1<=arguments.length?slice.call(arguments,0):[],t=$.Deferred(),nobodyPrevents.apply(null,e)&&t.resolve(),t.promise()},onEscape=function(e){return live("keydown","body",function(t){return u.escapePressed(t)?e(t):void 0})},snapshot=function(){var e,t,n,r;for(r=[],t=0,n=liveUpDescriptions.length;n>t;t++)e=liveUpDescriptions[t],r.push(e.isDefault=!0);return r},restoreSnapshot=function(){var e,t,n,r,o;for(t=u.reject(liveUpDescriptions,function(e){return e.isDefault}),o=[],n=0,r=t.length;r>n;n++)e=t[n],o.push(unbind.apply(null,e));return o},emitReset=function(){return emit("up:framework:reset",{message:"Resetting framework"})},boot=function(){return up.browser.isSupported()?(up.browser.installPolyfills(),emit("up:framework:boot",{message:"Booting framework"}),emit("up:framework:booted",{message:"Framework booted"}),u.nextFrame(function(){return u.whenReady().then(function(){return emit("up:app:boot",{message:"Booting user application"}),emit("up:app:booted",{message:"User application booted"})})})):void 0},live("up:framework:booted",snapshot),live("up:framework:reset",restoreSnapshot),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),on:live,off:unbind,emit:emit,nobodyPrevents:nobodyPrevents,whenEmitted:whenEmitted,onEscape:onEscape,emitReset:emitReset,boot:boot}}(jQuery),up.on=up.bus.on,up.off=up.bus.off,up.emit=up.bus.emit,up.reset=up.bus.emitReset,up.boot=up.bus.boot}.call(this),function(){var e=[].slice;up.log=function(){var t,n,r,o,i,u,a,s,l,c,p,f,d,m,h;return m=up.util,n=up.browser,t="up.log.enabled",r=m.config({prefix:"[UP] ",enabled:m.option(n.sessionStorage().getItem(t),!1),collapse:!1}),f=function(){return r.reset()},l=function(e){return""+r.prefix+e},o=function(){var t,o;return o=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],r.enabled&&o?n.puts.apply(n,["debug",l(o)].concat(e.call(t))):void 0},p=function(){var t,o;return o=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],r.enabled&&o?n.puts.apply(n,["log",l(o)].concat(e.call(t))):void 0},h=function(){var t,o;return o=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],r.enabled&&o?n.puts.apply(n,["warn",l(o)].concat(e.call(t))):void 0},s=function(){var t,o,i,u;if(i=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],o=t.pop(),!r.enabled||!i)return o();u=r.collapse?"groupCollapsed":"group",n.puts.apply(n,[u,l(i)].concat(e.call(t)));try{return o()}finally{i&&n.puts("groupEnd")}},a=function(){var t,r;return r=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],r?n.puts.apply(n,["error",l(r)].concat(e.call(t))):void 0},c=function(){var e;return e=" __ _____ ___ ___ / /_ __\n"+("/ // / _ \\/ _ \\/ _ \\/ / // / "+up.version+"\n")+"\\___/_//_/ .__/\\___/_/\\_. / \n / / / /\n\n",e+=r.enabled?"Call `up.log.disable()` to disable logging for this session.":"Call `up.log.enable()` to enable logging for this session.",n.puts("log",e)},up.on("up:framework:boot",c),up.on("up:framework:reset",f),d=function(e){return n.sessionStorage().setItem(t,e),r.enabled=e},u=function(){return d(!0)},i=function(){return d(!1)},{puts:p,debug:o,error:a,warn:h,group:s,config:r,enable:u,disable:i}}(jQuery),up.puts=up.log.puts}.call(this),function(){var e=[].slice;up.syntax=function(t){var n,r,o,i,u,a,s,l,c,p,f,d,m,h,v,g;return g=up.util,n="up-destructable",r="up-destructors",c=[],m=[],l=function(){var t;return t=1<=arguments.length?e.call(arguments,0):[],f.apply(null,[c].concat(e.call(t)))},d=function(){var t;return t=1<=arguments.length?e.call(arguments,0):[],f.apply(null,[m].concat(e.call(t)))},u=function(){var t,n,r,o;return o=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],n=t.pop(),r=g.options(t[0],{priority:0}),"first"===r.priority?r.priority=Number.POSITIVE_INFINITY:"last"===r.priority&&(r.priority=Number.NEGATIVE_INFINITY),{selector:o,callback:n,priority:r.priority,batch:r.batch,keep:r.keep}},f=function(){var t,n,r,o,i;if(i=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],up.browser.isSupported()){for(r=u.apply(null,t),n=0;(o=i[n])&&o.priority>=r.priority;)n+=1;return i.splice(n,0,r)}},i=function(e,t,n){var r,i;return up.puts(e.isDefault?void 0:"Compiling '%s' on %o",e.selector,n),e.keep&&(i=g.isString(e.keep)?e.keep:"",t.attr("up-keep",i)),r=e.callback.apply(n,[t,p(t)]),g.isFunction(r)?o(t,r):void 0},o=function(e,t){var o;return e.addClass(n),o=e.data(r)||[],o.push(t),e.data(r,o)},s=function(e,n){var r;return n=g.options(n),r=t(n.skip),up.log.group("Compiling fragment %o",e.get(0),function(){var n,o,u,a,s,p;for(s=[m,c],p=[],o=0,u=s.length;u>o;o++)a=s[o],p.push(function(){var o,u,s;for(s=[],o=0,u=a.length;u>o;o++)l=a[o],n=g.findWithSelf(e,l.selector),n=n.filter(function(){var e;return e=t(this),g.all(r,function(t){return 0===e.closest(t).length})}),s.push(n.length?up.log.group(l.isDefault?void 0:"Compiling '%s' on %d element(s)",l.selector,n.length,function(){return l.batch?i(l,n,n.get()):n.each(function(){return i(l,t(this),this)})}):void 0);return s}());return p})},a=function(e){return g.findWithSelf(e,"."+n).each(function(){var e,o,i,u,a;for(e=t(this),i=e.data(r),u=0,a=i.length;a>u;u++)(o=i[u])();return e.removeData(r),e.removeClass(n)})},p=function(e){var n,r;return n=t(e),r=n.attr("up-data"),g.isString(r)&&""!==g.trim(r)?JSON.parse(r):{}},v=function(){var e;return e=function(e){return e.isDefault=!0},g.each(c,e),g.each(m,e)},h=function(){var e;return e=function(e){return e.isDefault},c=g.select(c,e),m=g.select(m,e)},up.on("up:framework:booted",v),up.on("up:framework:reset",h),{compiler:l,macro:d,compile:s,clean:a,data:p}}(jQuery),up.compiler=up.syntax.compiler,up.macro=up.syntax.macro,up.ready=function(){return up.util.error("up.ready no longer exists. Please use up.hello instead.")},up.awaken=function(){return up.util.error("up.awaken no longer exists. Please use up.compiler instead.")}}.call(this),function(){up.history=function(e){var t,n,r,o,i,u,a,s,l,c,p,f,d,m,h,v;return v=up.util,n=v.config({popTargets:["body"],restoreScroll:!0}),c=void 0,u=void 0,m=function(){return n.reset(),c=void 0,u=void 0},a=function(e){return v.normalizeUrl(e,{hash:!0})},r=function(){return a(up.browser.url())},o=function(e){return a(e)===r()},s=function(e){return u&&(c=u,u=void 0),u=e},d=function(e){return i("replaceState",e)},p=function(e,t){return t=v.options(t,{force:!1}),e=a(e),!t.force&&o(e)||!up.bus.nobodyPrevents("up:history:push",{url:e,message:"Adding history entry for "+e})?void 0:(i("pushState",e),up.emit("up:history:pushed",{url:e,message:"Advanced to location "+e}))},i=function(e,n){var o;return up.browser.canPushState()?(o=t(),window.history[e](o,"",n),s(r())):v.error("This browser doesn't support history."+e)},t=function(){return{fromUp:!0}},h=function(e){var t;return(null!=e?e.fromUp:void 0)?(t=r(),up.log.group("Restoring URL %s",t,function(){var e;return e=n.popTargets.join(", "),up.replace(e,t,{history:!1,title:!0,reveal:!1,transition:"none",saveScroll:!1,restoreScroll:n.restoreScroll})})):up.puts("Ignoring a state not pushed by Unpoly (%o)",e)},l=function(e){var t,n;return s(r()),up.layout.saveScroll({url:c}),t=e.originalEvent.state,h(t),n=r(),up.emit("up:history:restored",{url:n,message:"Restored location "+n})},up.browser.canPushState()&&(f=function(){return e(window).on("popstate",l),d(r(),{force:!0})},"undefined"!=typeof jasmine&&null!==jasmine?f():setTimeout(f,100)),up.compiler("[up-back]",function(e){return v.isPresent(c)?(v.setMissingAttrs(e,{"up-href":c,"up-restore-scroll":""}),e.removeAttr("up-back"),up.link.makeFollowable(e)):void 0}),up.on("up:framework:reset",m),{config:n,defaults:function(){return v.error("up.history.defaults(...) no longer exists. Set values on he up.history.config property instead.")},push:p,replace:d,url:r,previousUrl:function(){return c},normalizeUrl:a}}(jQuery)}.call(this),function(){var slice=[].slice;up.layout=function($){var SCROLL_PROMISE_KEY,anchoredRight,config,finishScrolling,fixedChildren,lastScrollTops,measureObstruction,reset,restoreScroll,reveal,revealOrRestoreScroll,saveScroll,scroll,scrollTops,u,viewportOf,viewportSelector,viewports,viewportsWithin;return u=up.util,config=u.config({duration:0,viewports:[document,".up-modal-viewport","[up-viewport]"],fixedTop:["[up-fixed~=top]"],fixedBottom:["[up-fixed~=bottom]"],anchoredRight:["[up-anchored~=right]","[up-fixed~=top]","[up-fixed~=bottom]","[up-fixed~=right]"],snap:50,substance:150,easing:"swing"}),lastScrollTops=u.cache({size:30,key:up.history.normalizeUrl}),reset=function(){return config.reset(),lastScrollTops.clear()},SCROLL_PROMISE_KEY="up-scroll-promise",scroll=function(e,t,n){var r,o,i,a,s;return r=$(e),n=u.options(n),i=u.option(n.duration,config.duration),a=u.option(n.easing,config.easing),finishScrolling(r),i>0?(o=$.Deferred(),r.data(SCROLL_PROMISE_KEY,o),o.then(function(){return r.removeData(SCROLL_PROMISE_KEY),r.finish()}),s={scrollTop:t},r.get(0)===document&&(r=$("html, body")),r.animate(s,{duration:i,easing:a,complete:function(){return o.resolve()}}),o):(r.scrollTop(t),u.resolvedDeferred())},finishScrolling=function(e){return $(e).each(function(){var e;return(e=$(this).data(SCROLL_PROMISE_KEY))?e.resolve():void 0})},anchoredRight=function(){return u.multiSelector(config.anchoredRight).select()},measureObstruction=function(){var e,t,n,r;return n=function(e,t){var n,r;return n=$(e),r=n.css(t),u.isPresent(r)||u.error("Fixed element %o must have a CSS attribute %s",n.get(0),t),parseInt(r)+n.height()},t=function(){var e,t,o,i;for(o=$(config.fixedTop.join(", ")),i=[],e=0,t=o.length;t>e;e++)r=o[e],i.push(n(r,"top"));return i}(),e=function(){var e,t,o,i;for(o=$(config.fixedBottom.join(", ")),i=[],e=0,t=o.length;t>e;e++)r=o[e],i.push(n(r,"bottom"));return i}(),{top:Math.max.apply(Math,[0].concat(slice.call(t))),bottom:Math.max.apply(Math,[0].concat(slice.call(e)))}},reveal=function(e,t){var n,r,o,i,a,s,l,c,p,f,d,m,h,v;return n=$(e),up.puts("Revealing fragment %o",e.get(0)),t=u.options(t),r=t.viewport?$(t.viewport):viewportOf(n),m=u.option(t.snap,config.snap),v=r.is(document),h=v?u.clientSize().height:r.height(),p=r.scrollTop(),s=p,c=void 0,l=void 0,v?(l=measureObstruction(),c=0):(l={top:0,bottom:0},c=p),f=function(){return s+l.top},d=function(){return s+h-l.bottom-1},o=u.measure(n,{relative:r}),i=o.top+c,a=i+Math.min(o.height,config.substance)-1,a>d()&&(s+=a-d()),(i<f()||t.top)&&(s=i-l.top),m>s&&(s=0),s!==p?scroll(r,s,t):u.resolvedDeferred()},viewportSelector=function(){return u.multiSelector(config.viewports)},viewportOf=function(e,t){var n,r;return null==t&&(t={}),n=$(e),r=viewportSelector().seekUp(n),0===r.length&&t.strict!==!1&&u.error("Could not find viewport for %o",n),r},viewportsWithin=function(e){var t;return t=$(e),viewportSelector().findWithSelf(t)},viewports=function(){return viewportSelector().select()},scrollTops=function(){var e,t,n,r,o,i,u;for(i={},o=config.viewports,t=0,r=o.length;r>t;t++)u=o[t],e=$(u),e.length&&(n=u,u===document&&(n="document"),i[n]=e.scrollTop());return i},fixedChildren=function(e){var t,n;return null==e&&(e=void 0),e||(e=document.body),n=$(e),t=n.find("[up-fixed]"),u.isPresent(config.fixedTop)&&(t=t.add(n.find(config.fixedTop.join(", ")))),u.isPresent(config.fixedBottom)&&(t=t.add(n.find(config.fixedBottom.join(", ")))),t
|
2
|
+
},saveScroll=function(e){var t,n;return null==e&&(e={}),n=u.option(e.url,up.history.url()),t=u.option(e.tops,scrollTops()),up.puts("Saving scroll positions for URL %s (%o)",n,t),lastScrollTops.set(n,t)},restoreScroll=function(e){var t,n,r,o,i;return null==e&&(e={}),i=up.history.url(),r=void 0,e.around?(n=viewportsWithin(e.around),t=viewportOf(e.around),r=t.add(n)):r=viewports(),o=lastScrollTops.get(i),up.log.group("Restoring scroll positions for URL %s to %o",i,o,function(){var e,t,n,i;for(t in o)i=o[t],n="document"===t?document:t,e=r.filter(n),scroll(e,i,{duration:0});return u.resolvedDeferred()})},revealOrRestoreScroll=function(e,t){var n,r,o,i;return n=$(e),t.restoreScroll?restoreScroll({around:n}):t.reveal?(t.source&&(i=u.parseUrl(t.source),i.hash&&"#"!==i.hash&&(o=i.hash.substr(1),r=u.findWithSelf(n,"#"+o+", a[name='"+o+"']"),r.length&&(n=r))),reveal(n)):u.resolvedDeferred()},up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),reveal:reveal,scroll:scroll,finishScrolling:finishScrolling,config:config,defaults:function(){return u.error("up.layout.defaults(...) no longer exists. Set values on he up.layout.config property instead.")},viewportOf:viewportOf,viewportsWithin:viewportsWithin,viewports:viewports,scrollTops:scrollTops,saveScroll:saveScroll,restoreScroll:restoreScroll,revealOrRestoreScroll:revealOrRestoreScroll,anchoredRight:anchoredRight,fixedChildren:fixedChildren}}(jQuery),up.scroll=up.layout.scroll,up.reveal=up.layout.reveal}.call(this),function(){up.flow=function($){var autofocus,config,destroy,emitFragmentInserted,emitFragmentKept,extract,filterScripts,findKeepPlan,findOldFragment,first,firstInLayer,firstInPriority,hello,isRealElement,layerOf,matchesLayer,oldFragmentNotFound,parseImplantSteps,parseResponse,processResponse,reload,replace,reset,resolveSelector,setSource,shouldExtractTitle,source,swapElements,transferKeepableElements,u,updateHistory;return u=up.util,config=u.config({runInlineScripts:!0,runLinkedScripts:!1}),reset=function(){return config.reset()},setSource=function(e,t){var n;return n=$(e),u.isPresent(t)&&(t=u.normalizeUrl(t)),n.attr("up-source",t)},source=function(e){var t;return t=$(e).closest("[up-source]"),u.presence(t.attr("up-source"))||up.browser.url()},resolveSelector=function(e,t){var n,r;return u.isString(e)?(r=e,u.contains(r,"&")&&(t?(n=u.selectorForElement(t),r=r.replace(/\&/,n)):u.error("Found origin reference (%s) in selector %s, but options.origin is missing","&",r))):r=u.selectorForElement(e),r},replace=function(e,t,n){var r,o,i,a,s,l;return up.puts("Replacing %s from %s (%o)",e,t,n),n=u.options(n),l=resolveSelector(e,n.origin),r=u.option(n.failTarget,"body"),r=resolveSelector(r,n.origin),up.browser.canPushState()||n.history===!1?(s={url:t,method:n.method,data:n.data,target:l,failTarget:r,cache:n.cache,preload:n.preload,headers:n.headers},a=up.ajax(s),i=function(e,r,o){return processResponse(!0,l,t,s,o,n)},o=function(e){return processResponse(!1,r,t,s,e,n)},a=a.then(i,o)):(n.preload||up.browser.loadPage(t,u.only(n,"method","data")),u.unresolvablePromise())},processResponse=function(e,t,n,r,o,i){var a,s,l,c;return i.method=u.normalizeMethod(u.option(u.methodFromXhr(o),i.method)),a="GET"===i.method,(c=u.locationFromXhr(o))?(n=c,e&&up.proxy.isCachable(r)&&(s={url:n,method:u.methodFromXhr(o),target:t},up.proxy.alias(r,s))):a&&(l=u.requestDataAsQuery(i.data))&&(n=n+"?"+l),e?a?(i.history===!1||u.isString(i.history)||(i.history=n),i.source===!1||u.isString(i.source)||(i.source=n)):(u.isString(i.history)||(i.history=!1),u.isString(i.source)||(i.source="keep")):(i.transition=i.failTransition,i.failTransition=void 0,a?(i.history!==!1&&(i.history=n),i.source!==!1&&(i.source=n)):(i.source="keep",i.history=!1)),shouldExtractTitle(i)&&(i.title=u.titleFromXhr(o)),i.preload?u.resolvedPromise():extract(t,o.responseText,i)},shouldExtractTitle=function(e){return!(e.title===!1||u.isString(e.title)||e.history===!1&&e.title!==!0)},extract=function(e,t,n){return up.log.group("Extracting %s from %d bytes of HTML",e,null!=t?t.length:void 0,function(){var r,o,i;return n=u.options(n,{historyMethod:"push",requireMatch:!0,keep:!0,layer:"auto"}),i=resolveSelector(e,n.origin),o=parseResponse(t,n),shouldExtractTitle(n)&&(n.title=o.title()),n.saveScroll!==!1&&up.layout.saveScroll(),r=u.resolvedPromise(),n.beforeSwap&&(r=r.then(n.beforeSwap)),r=r.then(function(){return updateHistory(n)}),r=r.then(function(){var e,t,r,u,a;for(a=[],r=parseImplantSteps(i,n),e=0,t=r.length;t>e;e++)u=r[e],up.log.group("Updating %s",u.selector,function(){var e,t,r,i;return t=findOldFragment(u.selector,n),e=null!=(r=o.find(u.selector))?r.first():void 0,t&&e?(filterScripts(e,n),i=swapElements(t,e,u.pseudoClass,u.transition,n),a.push(i),n.reveal=!1):void 0});return $.when.apply($,a)}),n.afterSwap&&(r=r.then(n.afterSwap)),r})},findOldFragment=function(e,t){return first(e,t)||oldFragmentNotFound(e,t)},oldFragmentNotFound=function(e,t){var n,r;return t.requireMatch?(n=t.layer,"auto"===n&&(n="page, modal or popup"),r="Could not find selector %s in the current "+n,"#"===r[0]&&(r+=" (avoid using IDs)"),u.error(r,e)):void 0},filterScripts=function(e,t){var n,r,o,i,a,s,l,c,p,f;for(c=u.option(t.runInlineScripts,config.runInlineScripts),p=u.option(t.runLinkedScripts,config.runLinkedScripts),r=u.findWithSelf(e,"script"),l=[],a=0,s=r.length;s>a;a++)f=r[a],n=$(f),i=u.isPresent(n.attr("src")),o=!i,l.push(i&&p||o&&c?void 0:n.remove());return l},parseResponse=function(e,t){var n;return n=u.createElementFromHtml(e),{title:function(){var e;return null!=(e=n.querySelector("title"))?e.textContent:void 0},find:function(r){var o;return(o=$.find(r,n)[0])?$(o):t.requireMatch?u.error("Could not find selector %s in response %o",r,e):void 0}}},updateHistory=function(e){return e=u.options(e,{historyMethod:"push"}),e.history&&up.history[e.historyMethod](e.history),e.title?document.title=e.title:void 0},swapElements=function(e,t,n,r,o){var i,a,s,l;return r||(r="none"),"keep"===o.source&&(o=u.merge(o,{source:source(e)})),up.motion.finish(e),n?(i=t.contents().wrapAll('<div class="up-insertion"></div>').parent(),"before"===n?e.prepend(i):e.append(i),hello(i.children(),o),s=up.layout.revealOrRestoreScroll(i,o),s=s.then(function(){return up.animate(i,r,o)}),s=s.then(function(){return u.unwrapElement(i)})):(a=findKeepPlan(e,t,o))?(emitFragmentKept(a),s=u.resolvedPromise()):(l=function(){return o.keepPlans=transferKeepableElements(e,t,o),e.is("body")?(up.syntax.clean(e),e.replaceWith(t)):t.insertBefore(e),o.source!==!1&&setSource(t,o.source),autofocus(t),hello(t,o),up.morph(e,t,r,o)},s=destroy(e,{animation:l})),s},transferKeepableElements=function(e,t,n){var r,o,i,a,s,l,c,p;if(a=[],n.keep)for(p=e.find("[up-keep]"),i=0,l=p.length;l>i;i++)s=p[i],r=$(s),(c=findKeepPlan(r,t,u.merge(n,{descendantsOnly:!0})))&&(o=r.clone(),r.replaceWith(o),c.$newElement.replaceWith(r),a.push(c));return a},findKeepPlan=function(e,t,n){var r,o,i,a,s;return n.keep&&(r=e,(s=u.castedAttr(r,"up-keep"))&&(u.isString(s)||(s="&"),s=resolveSelector(s,r),o=n.descendantsOnly?t.find(s):u.findWithSelf(t,s),o=o.first(),o.length&&o.is("[up-keep]")&&(i={$element:r,$newElement:o,newData:up.syntax.data(o)},a=u.merge(i,{message:["Keeping element %o",r.get(0)]}),up.bus.nobodyPrevents("up:fragment:keep",a))))?i:void 0},parseImplantSteps=function(e,t){var n,r,o,i,a,s,l,c,p,f,d,m;for(d=t.transition||t.animation||"none",n=/\ *,\ */,r=e.split(n),m=u.isString(m)?d.split(n):[d],l=[],o=i=0,a=r.length;a>i;o=++i)c=r[o],p=c.match(/^(.+?)(?:\:(before|after))?$/),p||u.error('Could not parse selector atom "%s"',c),e=p[1],"html"===e&&(e="body"),s=p[2],f=m[o]||u.last(m),l.push({selector:e,pseudoClass:s,transition:f});return l},hello=function(e,t){var n,r,o,i,a,s;for(n=$(e),t=u.options(t,{keepPlans:[]}),o=[],s=t.keepPlans,r=0,i=s.length;i>r;r++)a=s[r],emitFragmentKept(a),o.push(a.$element);return up.syntax.compile(n,{skip:o}),emitFragmentInserted(n,t),n},emitFragmentInserted=function(e,t){var n;return n=$(e),up.emit("up:fragment:inserted",{$element:n,message:["Inserted fragment %o",n.get(0)],origin:t.origin})},emitFragmentKept=function(e){var t;return t=u.merge(e,{message:["Kept fragment %o",e.$element.get(0)]}),up.emit("up:fragment:kept",t)},autofocus=function(e){var t,n;return n="[autofocus]:last",t=u.findWithSelf(e,n),t.length&&t.get(0)!==document.activeElement?t.focus():void 0},isRealElement=function(e){var t;return t=".up-ghost, .up-destroying",0===e.closest(t).length},first=function(e,t){return t=u.options(t,{layer:"auto"}),"auto"===t.layer?firstInPriority(e,t.origin):firstInLayer(e,t.layer)},firstInPriority=function(e,t){var n,r,o,i,a,s;for(i=["popup","modal","page"],n=void 0,u.isPresent(t)&&(s=layerOf(t),u.remove(i,s),i.unshift(s)),r=0,a=i.length;a>r&&(o=i[r],!(n=firstInLayer(e,o)));r++);return n},firstInLayer=function(e,t){var n,r,o,i,u,a;for(r=$(e),o=void 0,u=0,a=r.length;a>u;u++)if(i=r[u],n=$(i),isRealElement(n)&&matchesLayer(n,t)){o=n;break}return o},layerOf=function(e){var t;return t=$(e),up.popup.contains(t)?"popup":up.modal.contains(t)?"modal":"page"},matchesLayer=function(e,t){return layerOf(e)===t},destroy=function(e,t){var n,r,o,i,a;return n=$(e),n.is(".up-placeholder, .up-tooltip, .up-modal, .up-popup")||(i=["Destroying fragment %o",n.get(0)],a=["Destroyed fragment %o",n.get(0)]),0===n.length?u.resolvedDeferred():up.bus.nobodyPrevents("up:fragment:destroy",{$element:n,message:i})?(t=u.options(t,{animation:!1}),r=up.motion.animateOptions(t),n.addClass("up-destroying"),updateHistory(t),o=u.presence(t.animation,u.isDeferred)||up.motion.animate(n,t.animation,r),o.then(function(){return up.syntax.clean(n),up.emit("up:fragment:destroyed",{$element:n,message:a}),n.remove()}),o):$.Deferred()},reload=function(e,t){var n;return t=u.options(t,{cache:!1}),n=t.url||source(e),replace(e,n,t)},up.on("up:app:boot",function(){var e;return e=$(document.body),setSource(e,up.browser.url()),hello(e)}),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),replace:replace,reload:reload,destroy:destroy,extract:extract,first:first,source:source,resolveSelector:resolveSelector,hello:hello,config:config}}(jQuery),up.replace=up.flow.replace,up.extract=up.flow.extract,up.reload=up.flow.reload,up.destroy=up.flow.destroy,up.first=up.flow.first,up.hello=up.flow.hello}.call(this),function(){var e=[].slice;up.motion=function(t){var n,r,o,i,u,a,s,l,c,p,f,d,m,h,v,g,y,b,w,k,S,x,A,$,D,T,E,C;return E=up.util,a={},c={},D={},p={},l=E.config({duration:300,delay:0,easing:"ease",enabled:!0}),k=function(){return m(),a=E.copy(c),D=E.copy(p),l.reset()},v=function(){return l.enabled&&up.browser.canCssTransition()},o=function(e,n,r){var u;return u=t(e),m(u),r=i(r),"none"===n||n===!1?b():E.isFunction(n)?s(n(u,r),n):E.isString(n)?o(u,d(n),r):E.isHash(n)?v()?E.cssAnimate(u,n,r):(u.css(n),E.resolvedDeferred()):E.error("Unknown animation type for %o",n)},i=function(){var t,n,r,o,i;return n=1<=arguments.length?e.call(arguments,0):[],i=n.shift()||{},t=E.isJQuery(n[0])?n.shift():E.nullJQuery(),o=E.isObject(n[0])?n.shift():{},r={},r.easing=E.option(i.easing,E.presentAttr(t,"up-easing"),o.easing,l.easing),r.duration=Number(E.option(i.duration,E.presentAttr(t,"up-duration"),o.duration,l.duration)),r.delay=Number(E.option(i.delay,E.presentAttr(t,"up-delay"),o.delay,l.delay)),r},d=function(e){return a[e]||E.error("Unknown animation %o",e)},r="up-ghosting-deferred",n="up-ghosting",C=function(e,t,o,i){var u,a,s,l,c,p,f,d;return o.copy===!1||e.is(".up-ghost")||t.is(".up-ghost")?i(e,t):(p=void 0,l=void 0,f=void 0,c=void 0,a=up.layout.viewportOf(e),u=e.add(t),E.temporaryCss(t,{display:"none"},function(){return p=w(e,a),f=a.scrollTop()}),E.temporaryCss(e,{display:"none"},function(){return up.layout.revealOrRestoreScroll(t,o),l=w(t,a),c=a.scrollTop()}),p.moveTop(c-f),e.hide(),d=E.temporaryCss(t,{opacity:"0"}),s=i(p.$ghost,l.$ghost),u.data(r,s),u.addClass(n),s.then(function(){return u.removeData(r),u.removeClass(n),d(),p.$bounds.remove(),l.$bounds.remove()}),s)},m=function(e){var r,o,i;return null==e&&(e=".up-animating"),o=t(e),r=E.findWithSelf(o,".up-animating"),E.finishCssAnimate(r),i=E.findWithSelf(o,"."+n),h(i)},h=function(e){return e.each(function(){var e,n;return e=t(this),(n=E.pluckData(e,r))?n.resolve():void 0})},s=function(e,t){return E.isDeferred(e)?e:E.error("Did not return a promise with .then and .resolve methods: %o",t)},y=function(e,n,r,u){var l,c;return"none"===r&&(r=!1),u=E.options(u),c=t(e),l=t(n),f(c,r),f(l,r),up.log.group(r?"Morphing %o to %o (using %s, %o)":void 0,c.get(0),l.get(0),r,u,function(){var e,t,n,p;return t=E.only(u,"reveal","restoreScroll","source"),t=E.extend(t,i(u)),v()?(m(c),m(l),r?(e=a[r])?(x(c,l,t),o(l,e,t)):(p=E.presence(r,E.isFunction)||D[r])?C(c,l,t,function(e,n){var o;return o=p(e,n,t),s(o,r)}):E.isString(r)&&r.indexOf("/")>=0?(n=r.split("/"),p=function(e,t,r){return S(o(e,n[0],r),o(t,n[1],r))},y(c,l,p,t)):E.error("Unknown transition %o",r):x(c,l,t)):x(c,l,t)})},f=function(e,t){var n;return t&&0===e.parents("body").length?(n=e.get(0),E.error("Can't morph a <%s> element (%o)",n.tagName,n)):void 0},x=function(e,t,n){return e.hide(),up.layout.revealOrRestoreScroll(t,n)},w=function(e,n){var r,o,i,u,a,s,l,c,p;for(u=E.measure(e,{relative:!0,inner:!0}),i=e.clone(),i.find("script").remove(),i.css({position:"static"===e.css("position")?"static":"relative",top:"auto",right:"auto",bottom:"auto",left:"auto",width:"100%",height:"100%"}),i.addClass("up-ghost"),r=t('<div class="up-bounds"></div>'),r.css({position:"absolute"}),r.css(u),p=u.top,c=function(e){return 0!==e?(p+=e,r.css({top:p})):void 0},i.appendTo(r),r.insertBefore(e),c(e.offset().top-i.offset().top),o=up.layout.fixedChildren(i),s=0,l=o.length;l>s;s++)a=o[s],E.fixedToAbsolute(a,n);return{$ghost:i,$bounds:r,moveTop:c}},$=function(e,t){return D[e]=t},u=function(e,t){return a[e]=t},A=function(){return c=E.copy(a),p=E.copy(D)},S=E.resolvableWhen,b=E.resolvedDeferred,g=function(e){return e===!1||"none"===e||e===b},u("none",b),u("fade-in",function(e,t){return e.css({opacity:0}),o(e,{opacity:1},t)}),u("fade-out",function(e,t){return e.css({opacity:1}),o(e,{opacity:0},t)}),T=function(e,t){return{transform:"translate("+e+"px, "+t+"px)"}},u("move-to-top",function(e,t){var n,r;return n=E.measure(e),r=n.top+n.height,e.css(T(0,0)),o(e,T(0,-r),t)}),u("move-from-top",function(e,t){var n,r;return n=E.measure(e),r=n.top+n.height,e.css(T(0,-r)),o(e,T(0,0),t)}),u("move-to-bottom",function(e,t){var n,r;return n=E.measure(e),r=E.clientSize().height-n.top,e.css(T(0,0)),o(e,T(0,r),t)}),u("move-from-bottom",function(e,t){var n,r;return n=E.measure(e),r=E.clientSize().height-n.top,e.css(T(0,r)),o(e,T(0,0),t)}),u("move-to-left",function(e,t){var n,r;return n=E.measure(e),r=n.left+n.width,e.css(T(0,0)),o(e,T(-r,0),t)}),u("move-from-left",function(e,t){var n,r;return n=E.measure(e),r=n.left+n.width,e.css(T(-r,0)),o(e,T(0,0),t)}),u("move-to-right",function(e,t){var n,r;return n=E.measure(e),r=E.clientSize().width-n.left,e.css(T(0,0)),o(e,T(r,0),t)}),u("move-from-right",function(e,t){var n,r;return n=E.measure(e),r=E.clientSize().width-n.left,e.css(T(r,0)),o(e,T(0,0),t)}),u("roll-down",function(e,t){var n,r,i;return r=e.height(),i=E.temporaryCss(e,{height:"0px",overflow:"hidden"}),n=o(e,{height:r+"px"},t),n.then(i),n}),$("none",b),$("move-left",function(e,t,n){return S(o(e,"move-to-left",n),o(t,"move-from-right",n))}),$("move-right",function(e,t,n){return S(o(e,"move-to-right",n),o(t,"move-from-left",n))}),$("move-up",function(e,t,n){return S(o(e,"move-to-top",n),o(t,"move-from-bottom",n))}),$("move-down",function(e,t,n){return S(o(e,"move-to-bottom",n),o(t,"move-from-top",n))}),$("cross-fade",function(e,t,n){return S(o(e,"fade-out",n),o(t,"fade-in",n))}),up.on("up:framework:booted",A),up.on("up:framework:reset",k),{morph:y,animate:o,animateOptions:i,finish:m,transition:$,animation:u,config:l,isEnabled:v,defaults:function(){return E.error("up.motion.defaults(...) no longer exists. Set values on he up.motion.config property instead.")},none:b,when:S,prependCopy:w,isNone:g}}(jQuery),up.transition=up.motion.transition,up.animation=up.motion.animation,up.morph=up.motion.morph,up.animate=up.motion.animate}.call(this),function(){var e=[].slice;up.proxy=function(t){var n,r,o,i,u,a,s,l,c,p,f,d,m,h,v,g,y,b,w,k,S,x,A,$,D,T,E,C,P,O,F,U,R,_;return _=up.util,n=void 0,$=void 0,F=void 0,S=void 0,U=void 0,T=[],p=_.config({slowDelay:300,preloadDelay:75,cacheSize:70,cacheExpiry:3e5,maxRequests:4,wrapMethods:["PATCH","PUT","DELETE"],wrapMethodParam:"_method",safeMethods:["GET","OPTIONS","HEAD"]}),u=function(e){return k(e),[e.url,e.method,_.requestDataAsQuery(e.data),e.target].join("|")},i=_.cache({size:function(){return p.cacheSize},expiry:function(){return p.cacheExpiry},key:u}),f=function(e){var t,n,r,o,u,a,s;if(e=k(e),m(e))for(n=[e],"html"!==e.target&&(a=_.merge(e,{target:"html"}),n.push(a),"body"!==e.target&&(u=_.merge(e,{target:"body"}),n.push(u))),r=0,o=n.length;o>r;r++)if(t=n[r],s=i.get(t))return s},a=function(){return clearTimeout($),$=null},s=function(){return clearTimeout(F),F=null},C=function(){return n=null,a(),s(),S=0,p.reset(),i.clear(),U=!1,T=[]},C(),k=function(e){return e._normalized||(e.method=_.normalizeMethod(e.method),e.url&&(e.url=_.normalizeUrl(e.url)),e.target||(e.target="body"),e._normalized=!0),e},r=function(){var t,n,r,o,i,u,a;return t=1<=arguments.length?e.call(arguments,0):[],o=_.extractOptions(t),_.isGiven(t[0])&&(o.url=t[0]),n=o.cache===!0,r=o.cache===!1,a=_.only(o,"url","method","data","target","headers","_normalized"),a=k(a),i=!0,h(a)||n?(u=f(a))&&!r?(up.puts("Re-using cached response for %s %s",a.method,a.url),i="pending"===u.state()):(u=b(a),O(a,u),u.fail(function(){return E(a)})):(c(),u=b(a)),i&&!o.preload&&(w(),u.always(y)),u},m=function(e){return!_.isFormData(e.data)},v=function(){return 0===S},d=function(){return S>0},w=function(){var e,t;return t=v(),S+=1,t?(e=function(){return d()?(up.emit("up:proxy:slow",{message:"Proxy is busy"}),U=!0):void 0},F=_.setTimer(p.slowDelay,e)):void 0},y=function(){return S-=1,v()&&U?(up.emit("up:proxy:recover",{message:"Proxy is idle"}),U=!1):void 0},b=function(e){return S<p.maxRequests?g(e):D(e)},D=function(e){var n,r;return up.puts("Queuing request for %s %s",e.method,e.url),n=t.Deferred(),r={deferred:n,request:e},T.push(r),n.promise()},g=function(e){var n;return up.emit("up:proxy:load",_.merge(e,{message:["Loading %s %s",e.method,e.url]})),e=_.copy(e),e.headers||(e.headers={}),e.headers["X-Up-Target"]=e.target,_.contains(p.wrapMethods,e.method)&&(e.data=_.appendRequestData(e.data,p.wrapMethodParam,e.method),e.method="POST"),_.isFormData(e.data)&&(e.contentType=!1,e.processData=!1),n=t.ajax(e),n.done(function(t,n,r){return P(e,r)}),n.fail(function(t){return P(e,t)}),n},P=function(e,t){var n;return up.emit("up:proxy:received",_.merge(e,{message:["Server responded with %s %s (%d bytes)",t.status,t.statusText,null!=(n=t.responseText)?n.length:void 0]})),x()},x=function(){var t,n;(t=T.shift())&&(n=g(t.request),n.done(function(){var n,r;return n=1<=arguments.length?e.call(arguments,0):[],(r=t.deferred).resolve.apply(r,n)}),n.fail(function(){var n,r;return n=1<=arguments.length?e.call(arguments,0):[],(r=t.deferred).reject.apply(r,n)}))},o=i.alias,O=i.set,E=i.remove,c=i.clear,h=function(e){return k(e),_.contains(p.safeMethods,e.method)},l=function(e){var t,r;return r=parseInt(_.presentAttr(e,"up-delay"))||p.preloadDelay,e.is(n)?void 0:(n=e,a(),t=function(){return A(e),n=null},R(t,r))},R=function(e,t){return $=setTimeout(e,t)},A=function(e,n){var r,o;return r=t(e),n=_.options(n),o=up.link.followMethod(r,n),h({method:o})?up.log.group("Preloading link %o",r,function(){return n.preload=!0,up.follow(r,n)}):(up.puts("Won't preload %o due to unsafe method %s",r,o),_.resolvedPromise())},up.on("mouseover mousedown touchstart","[up-preload]",function(e,t){return up.link.childClicked(e,t)?void 0:l(t)}),up.on("up:framework:reset",C),{preload:A,ajax:r,get:f,alias:o,clear:c,remove:E,isIdle:v,isBusy:d,isCachable:m,config:p,defaults:function(){return _.error("up.proxy.defaults(...) no longer exists. Set values on he up.proxy.config property instead.")}}}(jQuery),up.ajax=up.proxy.ajax}.call(this),function(){up.link=function($){var allowDefault,childClicked,follow,followMethod,followVariantSelectors,isFollowable,makeFollowable,onAction,shouldProcessLinkEvent,u,visit;return u=up.util,visit=function(e,t){var n;return t=u.options(t),n=u.option(t.target,"body"),up.replace(n,e,t)},follow=function(e,t){var n,r,o;return n=$(e),t=u.options(t),o=u.option(n.attr("up-href"),n.attr("href")),r=u.option(t.target,n.attr("up-target"),"body"),t.failTarget=u.option(t.failTarget,n.attr("up-fail-target"),"body"),t.transition=u.option(t.transition,u.castedAttr(n,"up-transition"),"none"),t.failTransition=u.option(t.failTransition,u.castedAttr(n,"up-fail-transition"),"none"),t.history=u.option(t.history,u.castedAttr(n,"up-history")),t.reveal=u.option(t.reveal,u.castedAttr(n,"up-reveal"),!0),t.cache=u.option(t.cache,u.castedAttr(n,"up-cache")),t.restoreScroll=u.option(t.restoreScroll,u.castedAttr(n,"up-restore-scroll")),t.method=followMethod(n,t),t.origin=u.option(t.origin,n),t.layer=u.option(t.layer,n.attr("up-layer"),"auto"),t.confirm=u.option(t.confirm,n.attr("up-confirm")),t=u.merge(t,up.motion.animateOptions(t,n)),up.browser.whenConfirmed(t).then(function(){return up.replace(r,o,t)})},followMethod=function(e,t){var n;return n=$(e),t=u.options(t),u.option(t.method,n.attr("up-method"),n.attr("data-method"),"get").toUpperCase()},childClicked=function(e,t){var n,r;return n=$(e.target),r=n.closest("a, [up-href]"),r.length&&t.find(r).length},shouldProcessLinkEvent=function(e,t){return u.isUnmodifiedMouseEvent(e)&&!childClicked(e,t)},followVariantSelectors=[],allowDefault=function(){},onAction=function(e,t){var n;return followVariantSelectors.push(e),n=function(e){return up.navigation.withActiveMark(e,{enlarge:!0},function(){return t(e)})},up.on("click","a"+e+", [up-href]"+e,function(e,t){return shouldProcessLinkEvent(e,t)?t.is("[up-instant]")?e.preventDefault():(e.preventDefault(),n(t)):allowDefault(e)}),up.on("mousedown","a"+e+"[up-instant], [up-href]"+e+"[up-instant]",function(e,t){return shouldProcessLinkEvent(e,t)?(e.preventDefault(),n(t)):void 0})},isFollowable=function(e){return u.any(followVariantSelectors,function(t){return e.is(t)})},makeFollowable=function(e){var t;return t=$(e),isFollowable(t)?void 0:t.attr("up-follow","")},onAction("[up-target]",function(e){return follow(e)}),onAction("[up-follow]",function(e){return follow(e)}),up.macro("[up-dash]",{priority:"last"},function(e){var t,n;return n=u.castedAttr(e,"up-dash"),e.removeAttr("up-dash"),t={"up-preload":"","up-instant":""},n===!0?makeFollowable(e):t["up-target"]=n,u.setMissingAttrs(e,t)}),up.macro("[up-expand]",{priority:"last"},function(e){var t,n,r,o,i,a,s,l,c,p;if(t=e.find("a, [up-href]"),(c=e.attr("up-expand"))&&(t=t.filter(c)),i=t.get(0)){for(p=/^up-/,s={},s["up-href"]=$(i).attr("href"),l=i.attributes,r=0,o=l.length;o>r;r++)n=l[r],a=n.name,a.match(p)&&(s[a]=n.value);return u.setMissingAttrs(e,s),e.removeAttr("up-expand"),makeFollowable(e)}}),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),visit:visit,follow:follow,makeFollowable:makeFollowable,shouldProcessLinkEvent:shouldProcessLinkEvent,childClicked:childClicked,followMethod:followMethod,onAction:onAction}}(jQuery),up.visit=up.link.visit,up.follow=up.link.follow}.call(this),function(){var slice=[].slice;up.form=function($){var autosubmit,config,currentValuesForSwitch,observe,observeForm,reset,resolveValidateTarget,submit,switchTargets,u,validate;return u=up.util,config=u.config({validateTargets:["[up-fieldset]:has(&)","fieldset:has(&)","label:has(&)","form:has(&)"],fields:[":input"],observeDelay:0}),reset=function(){return config.reset()},submit=function(e,t){var n,r,o,i,a,s,l;return n=$(e).closest("form"),t=u.options(t),s=u.option(t.target,n.attr("up-target"),"body"),l=u.option(t.url,n.attr("action"),up.browser.url()),t.failTarget=u.option(t.failTarget,n.attr("up-fail-target"))||u.selectorForElement(n),t.history=u.option(t.history,u.castedAttr(n,"up-history"),!0),t.transition=u.option(t.transition,u.castedAttr(n,"up-transition"),"none"),t.failTransition=u.option(t.failTransition,u.castedAttr(n,"up-fail-transition"),"none"),t.method=u.option(t.method,n.attr("up-method"),n.attr("data-method"),n.attr("method"),"post").toUpperCase(),t.headers=u.option(t.headers,{}),t.reveal=u.option(t.reveal,u.castedAttr(n,"up-reveal"),!0),t.cache=u.option(t.cache,u.castedAttr(n,"up-cache")),t.restoreScroll=u.option(t.restoreScroll,u.castedAttr(n,"up-restore-scroll")),t.origin=u.option(t.origin,n),t.layer=u.option(t.layer,n.attr("up-layer"),"auto"),t.data=up.util.requestDataFromForm(n),t=u.merge(t,up.motion.animateOptions(t,n)),i=n.find("input[type=file]").length,r=!i||u.isFormData(t.data),o=up.browser.canPushState()||t.history===!1,t.validate&&(t.headers||(t.headers={}),t.transition=!1,t.failTransition=!1,t.headers["X-Up-Validate"]=t.validate,!r)?u.unresolvablePromise():(up.navigation.markActive(n),r&&o?(a=up.replace(s,l,t),a.always(function(){return up.navigation.unmarkActive(n)}),a):(n.get(0).submit(),u.unresolvablePromise()))},observe=function(){var $element,args,callback,callbackArg,callbackPromise,callbackTimer,changeEvents,check,clearTimer,delay,knownValue,nextCallback,options,rawCallback,runNextCallback,selectorOrElement;return selectorOrElement=arguments[0],args=2<=arguments.length?slice.call(arguments,1):[],options={},callbackArg=void 0,1===args.length&&(callbackArg=args[0]),args.length>1&&(options=u.options(args[0]),callbackArg=args[1]),$element=$(selectorOrElement),options=u.options(options),delay=u.option($element.attr("up-delay"),options.delay,config.observeDelay),delay=parseInt(delay),callback=null,u.isGiven(options.change)&&u.error("up.observe now takes the change callback as the last argument"),rawCallback=u.option(u.presentAttr($element,"up-observe"),callbackArg),callback=u.isString(rawCallback)?function(value,$field){return eval(rawCallback)}:rawCallback||u.error("up.observe: No change callback given"),$element.is("form")?observeForm($element,options,callback):(knownValue=null,callbackTimer=null,callbackPromise=u.resolvedPromise(),nextCallback=null,runNextCallback=function(){var e;return nextCallback?(e=nextCallback(),nextCallback=null,e):void 0},check=function(){var e,t,n;return n=$element.val(),t=u.isNull(knownValue),knownValue===n||(knownValue=n,t)?void 0:(clearTimer(),nextCallback=function(){return callback.apply($element.get(0),[n,$element])},e=function(){return callbackPromise.then(function(){var e;return e=runNextCallback(),callbackPromise=u.isPromise(e)?e:u.resolvedPromise()})},u.setTimer(delay,e))},clearTimer=function(){return clearTimeout(callbackTimer)},changeEvents=up.browser.canInputEvent()?"input change":"input change keypress paste cut click propertychange",$element.on(changeEvents,check),check(),function(){return $element.off(changeEvents,check),clearTimer()})},observeForm=function(e,t,n){var r,o;return r=u.multiSelector(config.fields).find(e),o=u.map(r,function(e){return observe(e,n)}),function(){var e,t,n,r;for(r=[],t=0,n=o.length;n>t;t++)e=o[t],r.push(e());return r}},autosubmit=function(e,t){return observe(e,t,function(e,t){var n;return n=t.closest("form"),up.navigation.withActiveMark(t,function(){return submit(n)})})},resolveValidateTarget=function(e,t){var n;return n=u.option(t.target,e.attr("up-validate")),u.isBlank(n)&&(n||(n=u.detect(config.validateTargets,function(n){var r;return r=up.flow.resolveSelector(n,t.origin),e.closest(r).length}))),u.isBlank(n)&&u.error("Could not find default validation target for %o (tried ancestors %o)",e.get(0),config.validateTargets),u.isString(n)||(n=u.selectorForElement(n)),n},validate=function(e,t){var n,r,o;return n=$(e),t=u.options(t),t.origin=n,t.target=resolveValidateTarget(n,t),t.failTarget=t.target,t.history=!1,t.headers=u.option(t.headers,{}),t.validate=n.attr("name")||"__none__",t=u.merge(t,up.motion.animateOptions(t,n)),r=n.closest("form"),o=up.submit(r,t)},currentValuesForSwitch=function(e){var t,n,r;return r=void 0,e.is("input[type=checkbox]")?r=e.is(":checked")?[":checked",":present",e.val()]:[":unchecked",":blank"]:e.is("input[type=radio]")?(t=e.closest("form, body").find("input[type='radio'][name='"+e.attr("name")+"']:checked"),r=t.length?[":checked",":present",t.val()]:[":unchecked",":blank"]):(n=e.val(),r=u.isPresent(n)?[":present",n]:[":blank"]),r},currentValuesForSwitch=function(e){var t,n,r,o;return e.is("input[type=checkbox]")?e.is(":checked")?(r=e.val(),n=":checked"):n=":unchecked":e.is("input[type=radio]")?(t=e.closest("form, body").find("input[type='radio'][name='"+e.attr("name")+"']:checked"),t.length?(n=":checked",r=t.val()):n=":unchecked"):r=e.val(),o=[],u.isPresent(r)?(o.push(r),o.push(":present")):o.push(":blank"),u.isPresent(n)&&o.push(n),o},switchTargets=function(e,t){var n,r,o;return n=$(e),t=u.options(t),o=u.option(t.target,n.attr("up-switch")),u.isPresent(o)||u.error("No switch target given for %o",n.get(0)),r=currentValuesForSwitch(n),$(o).each(function(){var e,t,n,o;return e=$(this),(t=e.attr("up-hide-for"))?(t=t.split(" "),n=0===u.intersect(r,t).length):(o=(o=e.attr("up-show-for"))?o.split(" "):[":present",":checked"],n=u.intersect(r,o).length>0),e.toggle(n)})},up.on("submit","form[up-target]",function(e,t){return e.preventDefault(),submit(t)}),up.on("change","[up-validate]",function(e,t){return validate(t)}),up.on("change","[up-switch]",function(e,t){return switchTargets(t)}),up.compiler("[up-switch]",function(e){return switchTargets(e)}),up.compiler("[up-observe]",function(e){return observe(e)}),up.compiler("[up-autosubmit]",function(e){return autosubmit(e)}),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),config:config,submit:submit,observe:observe,validate:validate,switchTargets:switchTargets}}(jQuery),up.submit=up.form.submit,up.observe=up.form.observe,up.autosubmit=up.form.autosubmit,up.validate=up.form.validate}.call(this),function(){up.popup=function($){var align,attachAsap,attachNow,autoclose,chain,closeAsap,closeNow,config,contains,createFrame,discardHistory,isOpen,reset,state,u;return u=up.util,config=u.config({openAnimation:"fade-in",closeAnimation:"fade-out",openDuration:150,closeDuration:100,openEasing:null,closeEasing:null,position:"bottom-right",history:!1}),state=u.config({phase:"closed",$anchor:null,$popup:null,position:null,sticky:null,url:null,coveredUrl:null,coveredTitle:null}),chain=new u.DivertibleChain,reset=function(){var e;return null!=(e=state.$popup)&&e.remove(),state.reset(),chain.reset(),config.reset()},align=function(){var e,t,n;switch(e={},n=u.measure(state.$popup),u.isFixed(state.$anchor)?(t=state.$anchor.get(0).getBoundingClientRect(),e.position="fixed"):t=u.measure(state.$anchor),state.position){case"bottom-right":e.top=t.top+t.height,e.left=t.left+t.width-n.width;break;case"bottom-left":e.top=t.top+t.height,e.left=t.left;break;case"top-right":e.top=t.top-n.height,e.left=t.left+t.width-n.width;break;case"top-left":e.top=t.top-n.height,e.left=t.left;break;default:u.error("Unknown position option '%s'",state.position)}return state.$popup.attr("up-position",state.position),state.$popup.css(e)},discardHistory=function(){return state.coveredTitle=null,state.coveredUrl=null},createFrame=function(e){var t;return t=u.$createElementFromSelector(".up-popup"),u.$createPlaceholder(e,t),t.appendTo(document.body),state.$popup=t},isOpen=function(){return"opened"===state.phase||"opening"===state.phase},attachAsap=function(e,t){var n;return n=function(){return attachNow(e,t)},isOpen()?chain.asap(closeNow,n):chain.asap(n),chain.promise()},attachNow=function(e,t){var n,r,o,i,a,s;return n=$(e),n.length||u.error("Cannot attach popup to non-existing element %o",e),t=u.options(t),s=u.option(u.pluckKey(t,"url"),n.attr("up-href"),n.attr("href")),o=u.option(u.pluckKey(t,"html")),a=u.option(u.pluckKey(t,"target"),n.attr("up-popup"),"body"),i=u.option(t.position,n.attr("up-position"),config.position),t.animation=u.option(t.animation,n.attr("up-animation"),config.openAnimation),t.sticky=u.option(t.sticky,u.castedAttr(n,"up-sticky"),config.sticky),t.history=up.browser.canPushState()?u.option(t.history,u.castedAttr(n,"up-history"),config.history):!1,t.confirm=u.option(t.confirm,n.attr("up-confirm")),t.method=up.link.followMethod(n,t),t.layer="popup",r=up.motion.animateOptions(t,n,{duration:config.openDuration,easing:config.openEasing}),up.browser.whenConfirmed(t).then(function(){return up.bus.whenEmitted("up:popup:open",{url:s,message:"Opening popup"}).then(function(){var e,l;return state.phase="opening",state.$anchor=n,state.position=i,t.history&&(state.coveredUrl=up.browser.url(),state.coveredTitle=document.title),state.sticky=t.sticky,t.beforeSwap=function(){return createFrame(a)
|
3
|
+
},e=u.merge(t,{animation:!1}),l=o?up.extract(a,o,e):up.replace(a,s,e),l=l.then(function(){return align(),up.animate(state.$popup,t.animation,r)}),l=l.then(function(){return state.phase="opened",up.emit("up:popup:opened",{message:"Popup opened"})})})})},closeAsap=function(e){return isOpen()&&chain.asap(function(){return closeNow(e)}),chain.promise()},closeNow=function(e){var t;return isOpen()?(e=u.options(e,{animation:config.closeAnimation,history:state.coveredUrl,title:state.coveredTitle}),t=up.motion.animateOptions(e,{duration:config.closeDuration,easing:config.closeEasing}),u.extend(e,t),up.bus.whenEmitted("up:popup:close",{message:"Closing popup",$element:state.$popup}).then(function(){return state.phase="closing",state.url=null,state.coveredUrl=null,state.coveredTitle=null,up.destroy(state.$popup,e).then(function(){return state.phase="closed",state.$popup=null,state.$anchor=null,state.sticky=null,up.emit("up:popup:closed",{message:"Popup closed"})})})):u.resolvedPromise()},autoclose=function(){return state.sticky?void 0:(discardHistory(),closeAsap())},contains=function(e){var t;return t=$(e),t.closest(".up-popup").length>0},up.link.onAction("[up-popup]",function(e){return e.is(".up-current")?closeAsap():attachAsap(e)}),up.on("mousedown","body",function(e){var t;return t=$(e.target),t.closest(".up-popup, [up-popup]").length?void 0:closeAsap()}),up.on("up:fragment:inserted",function(e,t){var n;if(contains(t)){if(n=t.attr("up-source"))return state.url=n}else if(contains(e.origin))return autoclose()}),up.bus.onEscape(closeAsap),up.on("click","[up-close]",function(e,t){return contains(t)?(closeAsap(),e.preventDefault()):void 0}),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),attach:attachAsap,close:closeAsap,url:function(){return state.url},coveredUrl:function(){return state.coveredUrl},config:config,contains:contains,isOpen:isOpen}}(jQuery)}.call(this),function(){up.modal=function($){var animate,autoclose,chain,closeAsap,closeNow,config,contains,createFrame,discardHistory,extractAsap,flavor,flavorDefault,flavorOverrides,followAsap,isOpen,markAsAnimating,openAsap,openNow,reset,shiftElements,state,templateHtml,u,unshiftElements,visitAsap;return u=up.util,config=u.config({maxWidth:null,minWidth:null,width:null,height:null,history:!0,openAnimation:"fade-in",closeAnimation:"fade-out",openDuration:null,closeDuration:null,openEasing:null,closeEasing:null,backdropOpenAnimation:"fade-in",backdropCloseAnimation:"fade-out",closeLabel:"\xd7",flavors:{"default":{}},template:function(){return'<div class="up-modal">\n <div class="up-modal-backdrop"></div>\n <div class="up-modal-viewport">\n <div class="up-modal-dialog">\n <div class="up-modal-content"></div>\n <div class="up-modal-close" up-close>'+flavorDefault("closeLabel")+"</div>\n </div>\n </div>\n</div>"}}),state=u.config(function(){return{phase:"closed",$anchor:null,$modal:null,sticky:null,flavor:null,url:null,coveredUrl:null,coveredTitle:null,unshifters:[]}}),chain=new u.DivertibleChain,reset=function(){var e;return null!=(e=state.$modal)&&e.remove(),unshiftElements(),state.reset(),chain.reset(),config.reset()},templateHtml=function(){var e;return e=flavorDefault("template"),u.isFunction(e)?e(config):e},discardHistory=function(){return state.coveredTitle=null,state.coveredUrl=null},createFrame=function(e,t){var n,r,o;return o=$(templateHtml()),o.attr("up-flavor",state.flavor),r=o.find(".up-modal-dialog"),u.isPresent(t.width)&&r.css("width",t.width),u.isPresent(t.maxWidth)&&r.css("max-width",t.maxWidth),u.isPresent(t.height)&&r.css("height",t.height),n=o.find(".up-modal-content"),u.$createPlaceholder(e,n),o.appendTo(document.body),state.$modal=o},shiftElements=function(){var e,t,n,r,o;return u.documentHasVerticalScrollbar()?(e=$("body"),r=u.scrollbarWidth(),t=parseInt(e.css("padding-right")),n=r+t,o=u.temporaryCss(e,{"padding-right":n+"px","overflow-y":"hidden"}),state.unshifters.push(o),up.layout.anchoredRight().each(function(){var e,t,n,o;return e=$(this),t=parseInt(e.css("right")),n=r+t,o=u.temporaryCss(e,{right:n}),state.unshifters.push(o)})):void 0},unshiftElements=function(){var e,t;for(e=[];t=state.unshifters.pop();)e.push(t());return e},isOpen=function(){return"opened"===state.phase||"opening"===state.phase},followAsap=function(e,t){return t=u.options(t),t.$link=$(e),openAsap(t)},visitAsap=function(e,t){return t=u.options(t),t.url=e,openAsap(t)},extractAsap=function(e,t,n){return n=u.options(n),n.html=t,n.history=u.option(n.history,!1),n.target=e,openAsap(n)},openAsap=function(e){var t;return t=function(){return openNow(e)},isOpen()?chain.asap(closeNow,t):chain.asap(t),chain.promise()},openNow=function(e){var t,n,r,o,i;return e=u.options(e),t=u.option(u.pluckKey(e,"$link"),u.nullJQuery()),i=u.option(u.pluckKey(e,"url"),t.attr("up-href"),t.attr("href")),r=u.option(u.pluckKey(e,"html")),o=u.option(u.pluckKey(e,"target"),t.attr("up-modal"),"body"),e.flavor=u.option(e.flavor,t.attr("up-flavor")),e.width=u.option(e.width,t.attr("up-width"),flavorDefault("width",e.flavor)),e.maxWidth=u.option(e.maxWidth,t.attr("up-max-width"),flavorDefault("maxWidth",e.flavor)),e.height=u.option(e.height,t.attr("up-height"),flavorDefault("height")),e.animation=u.option(e.animation,t.attr("up-animation"),flavorDefault("openAnimation",e.flavor)),e.backdropAnimation=u.option(e.backdropAnimation,t.attr("up-backdrop-animation"),flavorDefault("backdropOpenAnimation",e.flavor)),e.sticky=u.option(e.sticky,u.castedAttr(t,"up-sticky"),flavorDefault("sticky",e.flavor)),e.confirm=u.option(e.confirm,t.attr("up-confirm")),e.method=up.link.followMethod(t,e),e.layer="modal",n=up.motion.animateOptions(e,t,{duration:flavorDefault("openDuration",e.flavor),easing:flavorDefault("openEasing",e.flavor)}),e.history=u.option(e.history,u.castedAttr(t,"up-history"),flavorDefault("history",e.flavor)),up.browser.canPushState()||(e.history=!1),up.browser.whenConfirmed(e).then(function(){return up.bus.whenEmitted("up:modal:open",{url:i,message:"Opening modal"}).then(function(){var t,a;return state.phase="opening",state.flavor=e.flavor,state.sticky=e.sticky,e.history&&(state.coveredUrl=up.browser.url(),state.coveredTitle=document.title),e.beforeSwap=function(){return createFrame(o,e)},t=u.merge(e,{animation:!1}),a=r?up.extract(o,r,t):up.replace(o,i,t),a=a.then(function(){return shiftElements(),animate(e.animation,e.backdropAnimation,n)}),a=a.then(function(){return state.phase="opened",up.emit("up:modal:opened",{message:"Modal opened"})})})})},closeAsap=function(e){return isOpen()&&chain.asap(function(){return closeNow(e)}),chain.promise()},closeNow=function(e){var t,n,r,o;return isOpen()?(e=u.options(e),o=u.option(e.animation,flavorDefault("closeAnimation")),n=u.option(e.backdropAnimation,flavorDefault("backdropCloseAnimation")),t=up.motion.animateOptions(e,{duration:flavorDefault("closeDuration"),easing:flavorDefault("closeEasing")}),r=u.options(u.except(e,"animation","duration","easing","delay"),{history:state.coveredUrl,title:state.coveredTitle}),up.bus.whenEmitted("up:modal:close",{$element:state.$modal,message:"Closing modal"}).then(function(){var e;return state.phase="closing",state.url=null,state.coveredUrl=null,state.coveredTitle=null,e=animate(o,n,t),e=e.then(function(){return up.destroy(state.$modal,r)}),e=e.then(function(){return unshiftElements(),state.phase="closed",state.$modal=null,state.flavor=null,state.sticky=null,up.emit("up:modal:closed",{message:"Modal closed"})})})):u.resolvedPromise()},markAsAnimating=function(e){return null==e&&(e=!0),state.$modal.toggleClass("up-modal-animating",e)},animate=function(e,t,n){var r;return up.motion.isNone(e)?u.resolvedPromise():(markAsAnimating(),r=$.when(up.animate(state.$modal.find(".up-modal-viewport"),e,n),up.animate(state.$modal.find(".up-modal-backdrop"),t,n)),r=r.then(function(){return markAsAnimating(!1)}))},autoclose=function(){return state.sticky?void 0:(discardHistory(),closeAsap())},contains=function(e){var t;return t=$(e),t.closest(".up-modal").length>0},flavor=function(e,t){return null==t&&(t={}),u.extend(flavorOverrides(e),t)},flavorOverrides=function(e){var t;return(t=config.flavors)[e]||(t[e]={})},flavorDefault=function(e,t){var n;return null==t&&(t=state.flavor),t&&(n=flavorOverrides(t)[e]),u.isMissing(n)&&(n=config[e]),n},up.link.onAction("[up-modal]",function(e){return followAsap(e)}),up.on("click","body",function(e){var t;return t=$(e.target),t.closest(".up-modal-dialog").length||t.closest("[up-modal]").length?void 0:closeAsap()}),up.on("up:fragment:inserted",function(e,t){var n;if(contains(t)){if(n=t.attr("up-source"))return state.url=n}else if(contains(e.origin)&&!up.popup.contains(t))return autoclose()}),up.bus.onEscape(closeAsap),up.on("click","[up-close]",function(e,t){return contains(t)?(closeAsap(),e.preventDefault()):void 0}),up.on("up:framework:reset",reset),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),visit:visitAsap,follow:followAsap,extract:extractAsap,close:closeAsap,url:function(){return state.url},coveredUrl:function(){return state.coveredUrl},config:config,contains:contains,isOpen:isOpen,flavor:flavor}}(jQuery)}.call(this),function(){up.tooltip=function(e){var t,n,r,o,i,u,a,s,l,c,p,f;return f=up.util,a=f.config({position:"top",openAnimation:"fade-in",closeAnimation:"fade-out",openDuration:100,closeDuration:50,openEasing:null,closeEasing:null}),p=f.config({phase:"closed",$anchor:null,$tooltip:null,position:null}),o=new f.DivertibleChain,c=function(){var e;return null!=(e=p.$tooltip)&&e.remove(),p.reset(),o.reset(),a.reset()},t=function(){var e,t,n;switch(e={},n=f.measure(p.$tooltip),f.isFixed(p.$anchor)?(t=p.$anchor.get(0).getBoundingClientRect(),e.position="fixed"):t=f.measure(p.$anchor),p.position){case"top":e.top=t.top-n.height,e.left=t.left+.5*(t.width-n.width);break;case"left":e.top=t.top+.5*(t.height-n.height),e.left=t.left-n.width;break;case"right":e.top=t.top+.5*(t.height-n.height),e.left=t.left+t.width;break;case"bottom":e.top=t.top+t.height,e.left=t.left+.5*(t.width-n.width);break;default:f.error("Unknown position option '%s'",p.position)}return p.$tooltip.attr("up-position",p.position),p.$tooltip.css(e)},s=function(e){var t;return t=f.$createElementFromSelector(".up-tooltip"),f.isGiven(e.text)?t.text(e.text):t.html(e.html),t.appendTo(document.body),p.$tooltip=t},n=function(e,t){var n;return null==t&&(t={}),n=function(){return r(e,t)},l()?o.asap(u,n):o.asap(n),o.promise()},r=function(n,r){var o,i,u,l,c,d;return o=e(n),r=f.options(r),l=f.option(r.html,o.attr("up-tooltip-html")),d=f.option(r.text,o.attr("up-tooltip")),c=f.option(r.position,o.attr("up-position"),a.position),u=f.option(r.animation,f.castedAttr(o,"up-animation"),a.openAnimation),i=up.motion.animateOptions(r,o,{duration:a.openDuration,easing:a.openEasing}),p.phase="opening",p.$anchor=o,s({text:d,html:l}),p.position=c,t(),up.animate(p.$tooltip,u,i).then(function(){return p.phase="opened"})},i=function(e){return l()&&o.asap(function(){return u(e)}),o.promise()},u=function(e){var t;return l()?(e=f.options(e,{animation:a.closeAnimation}),t=up.motion.animateOptions(e,{duration:a.closeDuration,easing:a.closeEasing}),f.extend(e,t),p.phase="closing",up.destroy(p.$tooltip,e).then(function(){return p.phase="closed",p.$tooltip=null,p.$anchor=null})):f.resolvedPromise()},l=function(){return"opening"===p.phase||"opened"===p.phase},up.compiler("[up-tooltip], [up-tooltip-html]",function(e){return e.on("mouseenter",function(){return n(e)}),e.on("mouseleave",function(){return i()})}),up.on("click","body",function(){return i()}),up.on("up:framework:reset",c),up.bus.onEscape(function(){return i()}),{config:a,attach:n,isOpen:l,close:i}}(jQuery)}.call(this),function(){var e=[].slice;up.navigation=function(t){var n,r,o,i,u,a,s,l,c,p,f,d,m,h;return f=up.util,o=f.config({currentClasses:["up-current"]}),c=function(){return o.reset()},i=function(){var e;return e=o.currentClasses,e=e.concat(["up-current"]),e=f.uniq(e),e.join(" ")},n="up-active",r="a, [up-href]",l=function(e){return f.isPresent(e)?f.normalizeUrl(e):void 0},p=function(e){var t,n,r,o,i,u,a,s,c,p;for(s=[],u=["href","up-href","up-alias"],n=0,o=u.length;o>n;n++)if(t=u[n],c=f.presentAttr(e,t))for(p="up-alias"===t?c.split(" "):[c],r=0,i=p.length;i>r;r++)a=p[r],"#"!==a&&(a=l(a),s.push(a));return s},m=function(e){var t,n,r,o;return e=f.compact(e),r=function(e){return"*"===e.substr(-1)?n(e.slice(0,-1)):t(e)},t=function(t){return f.contains(e,t)},n=function(t){return f.detect(e,function(e){return 0===e.indexOf(t)})},o=function(e){return f.detect(e,r)},{matchesAny:o}},a=function(){var e,n;return e=m([l(up.browser.url()),l(up.modal.url()),l(up.modal.coveredUrl()),l(up.popup.url()),l(up.popup.coveredUrl())]),n=i(),f.each(t(r),function(r){var o,i;return o=t(r),i=p(o),e.matchesAny(i)?o.addClass(n):o.hasClass(n)&&0===o.closest(".up-destroying").length?o.removeClass(n):void 0})},u=function(e,n){var o;return o=t(e),n=f.options(n,{enlarge:!1}),n.enlarge?f.presence(o.parent(r))||o:o},s=function(e,t){var r;return r=u(e,t),r.addClass(n)},d=function(e,t){var r;return r=u(e,t),r.removeClass(n)},h=function(){var n,r,o,i,u,a;return i=arguments[0],r=2<=arguments.length?e.call(arguments,1):[],o=r.pop(),u=f.options(r.pop()),n=t(i),s(n,u),a=o(),f.isPromise(a)?a.always(function(){return d(n,u)}):up.warn("Expected block to return a promise, but got %o",a),a},up.on("up:fragment:inserted",function(){return a()}),up.on("up:fragment:destroyed",function(e,t){return t.is(".up-modal, .up-popup")?a():void 0}),up.on("up:framework:reset",c),{config:o,defaults:function(){return f.error("up.navigation.defaults(...) no longer exists. Set values on he up.navigation.config property instead.")},markActive:s,unmarkActive:d,withActiveMark:h}}(jQuery)}.call(this),function(){up.rails=function(e){var t,n,r,o;return r=up.util,o=function(e){return e.is("[up-follow], [up-target], [up-modal], [up-popup]")},n=function(){return r.isGiven(e.rails)},r.each(["method","confirm"],function(e){var t,i;return t="data-"+e,i="up-"+e,up.compiler("["+t+"]",function(e){var u;return n()&&o(e)?(u={},u[i]=e.attr(t),r.setMissingAttrs(e,u),e.removeAttr(t)):void 0})}),t=function(){return n()?{name:e.rails.csrfParam(),value:e.rails.csrfToken()}:void 0},{csrfField:t,isRails:n}}(jQuery)}.call(this),function(){up.boot()}.call(this);
|
@@ -158,6 +158,10 @@ up.flow = (($) ->
|
|
158
158
|
@param {String} [options.failTarget='body']
|
159
159
|
The CSS selector to update if the server sends a non-200 status code.
|
160
160
|
@param {String} [options.title]
|
161
|
+
The document title after the replacement.
|
162
|
+
|
163
|
+
If the call pushes an history entry and this option is missing, the title is extracted from the response's `<title>` tag.
|
164
|
+
You can also pass `false` to explicitly prevent the title from being updated.
|
161
165
|
@param {String} [options.method='get']
|
162
166
|
The HTTP method to use for the request.
|
163
167
|
@param {Object|Array} [options.data]
|
@@ -245,10 +249,6 @@ up.flow = (($) ->
|
|
245
249
|
###
|
246
250
|
processResponse = (isSuccess, selector, url, request, xhr, options) ->
|
247
251
|
options.method = u.normalizeMethod(u.option(u.methodFromXhr(xhr), options.method))
|
248
|
-
options.title = u.option(u.titleFromXhr(xhr), options.title)
|
249
|
-
|
250
|
-
unless options.title is false || u.isString(options.title) || (options.history is false && options.title isnt true)
|
251
|
-
options.title = u.titleFromXhr(xhr)
|
252
252
|
|
253
253
|
isReloadable = (options.method == 'GET')
|
254
254
|
|
@@ -284,11 +284,16 @@ up.flow = (($) ->
|
|
284
284
|
options.source = 'keep'
|
285
285
|
options.history = false
|
286
286
|
|
287
|
+
options.title = u.titleFromXhr(xhr) if shouldExtractTitle(options)
|
288
|
+
|
287
289
|
if options.preload
|
288
290
|
u.resolvedPromise()
|
289
291
|
else
|
290
292
|
extract(selector, xhr.responseText, options)
|
291
293
|
|
294
|
+
shouldExtractTitle = (options) ->
|
295
|
+
not (options.title is false || u.isString(options.title) || (options.history is false && options.title isnt true))
|
296
|
+
|
292
297
|
###*
|
293
298
|
Updates a selector on the current page with the
|
294
299
|
same selector from the given HTML string.
|
@@ -337,7 +342,7 @@ up.flow = (($) ->
|
|
337
342
|
)
|
338
343
|
selector = resolveSelector(selectorOrElement, options.origin)
|
339
344
|
response = parseResponse(html, options)
|
340
|
-
options.title
|
345
|
+
options.title = response.title() if shouldExtractTitle(options)
|
341
346
|
|
342
347
|
up.layout.saveScroll() unless options.saveScroll == false
|
343
348
|
|
@@ -399,10 +404,11 @@ up.flow = (($) ->
|
|
399
404
|
u.error("Could not find selector %s in response %o", selector, html)
|
400
405
|
|
401
406
|
updateHistory = (options) ->
|
402
|
-
|
403
|
-
document.title = options.title
|
407
|
+
options = u.options(options, historyMethod: 'push')
|
404
408
|
if options.history
|
405
409
|
up.history[options.historyMethod](options.history)
|
410
|
+
if options.title
|
411
|
+
document.title = options.title
|
406
412
|
|
407
413
|
swapElements = ($old, $new, pseudoClass, transition, options) ->
|
408
414
|
transition ||= 'none'
|
@@ -777,8 +783,10 @@ up.flow = (($) ->
|
|
777
783
|
|
778
784
|
@function up.destroy
|
779
785
|
@param {String|Element|jQuery} selectorOrElement
|
780
|
-
@param {String} [options.
|
786
|
+
@param {String} [options.history]
|
787
|
+
A URL that will be pushed as a new history entry when the element begins destruction.
|
781
788
|
@param {String} [options.title]
|
789
|
+
The document title to set when the element begins destruction.
|
782
790
|
@param {String|Function} [options.animation='none']
|
783
791
|
The animation to use before the element is removed from the DOM.
|
784
792
|
@param {Number} [options.duration]
|
@@ -806,8 +814,7 @@ up.flow = (($) ->
|
|
806
814
|
# If e.g. a modal or popup asks us to restore a URL, do this
|
807
815
|
# before emitting `fragment:destroy`. This way up.navigate sees the
|
808
816
|
# new URL and can assign/remove .up-current classes accordingly.
|
809
|
-
|
810
|
-
document.title = options.title if u.isPresent(options.title)
|
817
|
+
updateHistory(options)
|
811
818
|
|
812
819
|
animationDeferred = u.presence(options.animation, u.isDeferred) ||
|
813
820
|
up.motion.animate($element, options.animation, animateOptions)
|
@@ -398,8 +398,9 @@ up.modal = (($) ->
|
|
398
398
|
state.phase = 'opening'
|
399
399
|
state.flavor = options.flavor
|
400
400
|
state.sticky = options.sticky
|
401
|
-
|
402
|
-
|
401
|
+
if options.history
|
402
|
+
state.coveredUrl = up.browser.url()
|
403
|
+
state.coveredTitle = document.title
|
403
404
|
options.beforeSwap = -> createFrame(target, options)
|
404
405
|
extractOptions = u.merge(options, animation: false)
|
405
406
|
if html
|
@@ -461,7 +462,7 @@ up.modal = (($) ->
|
|
461
462
|
|
462
463
|
destroyOptions = u.options(
|
463
464
|
u.except(options, 'animation', 'duration', 'easing', 'delay'),
|
464
|
-
|
465
|
+
history: state.coveredUrl,
|
465
466
|
title: state.coveredTitle
|
466
467
|
)
|
467
468
|
|
@@ -236,8 +236,9 @@ up.popup = (($) ->
|
|
236
236
|
state.phase = 'opening'
|
237
237
|
state.$anchor = $anchor
|
238
238
|
state.position = position
|
239
|
-
|
240
|
-
|
239
|
+
if options.history
|
240
|
+
state.coveredUrl = up.browser.url()
|
241
|
+
state.coveredTitle = document.title
|
241
242
|
state.sticky = options.sticky
|
242
243
|
options.beforeSwap = -> createFrame(target)
|
243
244
|
extractOptions = u.merge(options, animation: false)
|
@@ -295,7 +296,7 @@ up.popup = (($) ->
|
|
295
296
|
|
296
297
|
options = u.options(options,
|
297
298
|
animation: config.closeAnimation
|
298
|
-
|
299
|
+
history: state.coveredUrl,
|
299
300
|
title: state.coveredTitle
|
300
301
|
)
|
301
302
|
animateOptions = up.motion.animateOptions(options, duration: config.closeDuration, easing: config.closeEasing)
|
data/lib/unpoly/rails/version.rb
CHANGED
data/spec_app/Gemfile.lock
CHANGED
@@ -208,10 +208,11 @@ describe 'up.flow', ->
|
|
208
208
|
@respond()
|
209
209
|
expect(up.flow.source('.middle')).toEndWith('/given-path')
|
210
210
|
|
211
|
-
it '
|
211
|
+
it 'ignores the option and reuses the previous source after a failed non-GET request', ->
|
212
|
+
@oldMiddle.attr('up-source', '/previous-source')
|
212
213
|
promise = up.replace('.middle', '/path', method: 'post', source: '/given-path', failTarget: '.middle')
|
213
214
|
@respond(status: 500)
|
214
|
-
expect(up.flow.source('.middle')).toEndWith(
|
215
|
+
expect(up.flow.source('.middle')).toEndWith('/previous-source')
|
215
216
|
|
216
217
|
it 'understands non-standard CSS selector extensions such as :has(...)', (done) ->
|
217
218
|
$first = affix('.boxx#first')
|
@@ -265,6 +266,45 @@ describe 'up.flow', ->
|
|
265
266
|
expect($('.container')).toHaveText('new container text')
|
266
267
|
expect(document.title).toBe('Title from header')
|
267
268
|
|
269
|
+
it "does not extract the title from the response or HTTP header if history isn't updated", ->
|
270
|
+
affix('.container').text('old container text')
|
271
|
+
document.title = 'old document title'
|
272
|
+
up.replace('.container', '/path', history: false)
|
273
|
+
@respondWith
|
274
|
+
responseHeaders:
|
275
|
+
'X-Up-Title': 'Title from header'
|
276
|
+
responseText: """
|
277
|
+
<html>
|
278
|
+
<head>
|
279
|
+
<title>Title from HTML</title>
|
280
|
+
</head>
|
281
|
+
<body>
|
282
|
+
<div class='container'>
|
283
|
+
new container text
|
284
|
+
</div>
|
285
|
+
</body>
|
286
|
+
</html>
|
287
|
+
"""
|
288
|
+
expect(document.title).toBe('old document title')
|
289
|
+
|
290
|
+
it 'allows to pass an explicit title as { title } option', ->
|
291
|
+
affix('.container').text('old container text')
|
292
|
+
up.replace('.container', '/path', title: 'Title from options')
|
293
|
+
@respondWith """
|
294
|
+
<html>
|
295
|
+
<head>
|
296
|
+
<title>Title from HTML</title>
|
297
|
+
</head>
|
298
|
+
<body>
|
299
|
+
<div class='container'>
|
300
|
+
new container text
|
301
|
+
</div>
|
302
|
+
</body>
|
303
|
+
</html>
|
304
|
+
"""
|
305
|
+
expect($('.container')).toHaveText('new container text')
|
306
|
+
expect(document.title).toBe('Title from options')
|
307
|
+
|
268
308
|
describe 'selector processing', ->
|
269
309
|
|
270
310
|
it 'replaces multiple selectors separated with a comma', (done) ->
|
@@ -952,6 +992,17 @@ describe 'up.flow', ->
|
|
952
992
|
up.destroy('.element')
|
953
993
|
expect(destructor).toHaveBeenCalled()
|
954
994
|
|
995
|
+
it 'allows to pass a new history entry as { history } option', ->
|
996
|
+
affix('.element')
|
997
|
+
up.destroy('.element', history: '/new-path')
|
998
|
+
expect(location.href).toEndWith('/new-path')
|
999
|
+
|
1000
|
+
it 'allows to pass a new document title as { title } option', ->
|
1001
|
+
affix('.element')
|
1002
|
+
up.destroy('.element', history: '/new-path', title: 'Title from options')
|
1003
|
+
expect(document.title).toEqual('Title from options')
|
1004
|
+
|
1005
|
+
|
955
1006
|
describe 'up.reload', ->
|
956
1007
|
|
957
1008
|
describeCapability 'canPushState', ->
|
@@ -197,12 +197,14 @@ describe 'up.modal', ->
|
|
197
197
|
up.modal.config.closeAnimation = 'fade-out'
|
198
198
|
up.modal.config.closeDuration = 50
|
199
199
|
|
200
|
+
# Open the first modal
|
200
201
|
up.modal.extract('.target', '<div class="target">response1</div>')
|
201
202
|
|
202
203
|
u.setTimer 10, ->
|
203
204
|
# First modal is still in its opening animation
|
204
205
|
expect($('.target')).toHaveText('response1')
|
205
206
|
|
207
|
+
# Open a second modal
|
206
208
|
up.modal.extract('.target', '<div class="target">response2</div>')
|
207
209
|
|
208
210
|
# First modal is starting close animation. Second modal waits for that.
|
@@ -212,7 +214,7 @@ describe 'up.modal', ->
|
|
212
214
|
# Second modal is still waiting for first modal's closing animaton to finish.
|
213
215
|
expect($('.target')).toHaveText('response1')
|
214
216
|
|
215
|
-
u.setTimer
|
217
|
+
u.setTimer 150, ->
|
216
218
|
# First modal has finished closing, second modal has finished opening.
|
217
219
|
expect($('.target')).toHaveText('response2')
|
218
220
|
|
@@ -133,7 +133,7 @@ describe 'up.popup', ->
|
|
133
133
|
up.history.replace('/foo')
|
134
134
|
expect(up.popup.coveredUrl()).toBeMissing()
|
135
135
|
|
136
|
-
$popupLink = affix('a[href="/bar"][up-popup=".container"]')
|
136
|
+
$popupLink = affix('a[href="/bar"][up-popup=".container"][up-history="true"]')
|
137
137
|
$popupLink.click()
|
138
138
|
@respondWith('<div class="container">text</div>')
|
139
139
|
expect(up.popup.coveredUrl()).toEndWith('/foo')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unpoly-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.27.
|
4
|
+
version: 0.27.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henning Koch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|