unpoly-rails 0.31.2 → 0.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of unpoly-rails might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +49 -5
- data/README.md +21 -15
- data/README_RAILS.md +2 -2
- data/Rakefile +1 -1
- data/bower.json +4 -3
- data/design/homepage.txt +2 -2
- data/dist/unpoly-bootstrap3.css +3 -0
- data/dist/unpoly-bootstrap3.min.css +1 -1
- data/dist/unpoly.css +4 -4
- data/dist/unpoly.js +114 -80
- data/dist/unpoly.min.css +1 -1
- data/dist/unpoly.min.js +3 -3
- data/lib/assets/javascripts/unpoly/browser.js.coffee +1 -1
- data/lib/assets/javascripts/unpoly/bus.js.coffee +3 -3
- data/lib/assets/javascripts/unpoly/flow.js.coffee +15 -11
- data/lib/assets/javascripts/unpoly/form.js.coffee +1 -1
- data/lib/assets/javascripts/unpoly/layout.js.coffee +12 -9
- data/lib/assets/javascripts/unpoly/link.js.coffee +22 -7
- data/lib/assets/javascripts/unpoly/log.js.coffee +3 -2
- data/lib/assets/javascripts/unpoly/modal.js.coffee +11 -13
- data/lib/assets/javascripts/unpoly/motion.js.coffee +1 -1
- data/lib/assets/javascripts/unpoly/navigation.js.coffee +5 -5
- data/lib/assets/javascripts/unpoly/popup.js.coffee +8 -9
- data/lib/assets/javascripts/unpoly/proxy.js.coffee +2 -2
- data/lib/assets/javascripts/unpoly/syntax.js.coffee +19 -15
- data/lib/assets/javascripts/unpoly/util.js.coffee +19 -3
- data/lib/assets/stylesheets/unpoly-bootstrap3/modal-ext.css.sass +6 -1
- data/lib/assets/stylesheets/unpoly/modal.css.sass +7 -2
- data/lib/unpoly/rails/version.rb +1 -1
- data/package.json +2 -2
- data/spec_app/Gemfile.lock +1 -1
- data/spec_app/app/assets/javascripts/bootstrap_manifest.coffee +2 -2
- data/spec_app/app/views/css_test/modal.erb +4 -0
- data/spec_app/app/views/css_test/modal_contents_wide.erb +5 -0
- data/spec_app/app/views/layouts/integration_test.erb +1 -0
- data/spec_app/spec/javascripts/helpers/knife.js.coffee +1 -1
- data/spec_app/spec/javascripts/up/browser_spec.js.coffee +1 -1
- data/spec_app/spec/javascripts/up/bus_spec.js.coffee +1 -1
- data/spec_app/spec/javascripts/up/flow_spec.js.coffee +63 -5
- data/spec_app/spec/javascripts/up/form_spec.js.coffee +2 -2
- data/spec_app/spec/javascripts/up/history_spec.js.coffee +1 -1
- data/spec_app/spec/javascripts/up/layout_spec.js.coffee +27 -1
- data/spec_app/spec/javascripts/up/link_spec.js.coffee +3 -3
- data/spec_app/spec/javascripts/up/log_spec.js.coffee +1 -1
- data/spec_app/spec/javascripts/up/modal_spec.js.coffee +3 -3
- data/spec_app/spec/javascripts/up/motion_spec.js.coffee +1 -1
- data/spec_app/spec/javascripts/up/popup_spec.js.coffee +21 -3
- data/spec_app/spec/javascripts/up/proxy_spec.js.coffee +1 -1
- data/spec_app/spec/javascripts/up/syntax_spec.js.coffee +1 -1
- data/spec_app/spec/javascripts/up/tooltip_spec.js.coffee +1 -1
- data/spec_app/spec/javascripts/up/util_spec.js.coffee +2 -2
- data/spec_app/vendor/assets/bower_components/jasmine-jquery/README.md +2 -2
- data/unpoly-rails.gemspec +1 -1
- metadata +5 -4
data/dist/unpoly.min.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
[up-close]{cursor:pointer}.up-insertion{display:inline-block}[up-href]{cursor:pointer}.up-modal{position:fixed;top:0;left:0;bottom:0;right:0;z-index:10000;overflow-x:hidden}.up-modal-backdrop{z-index:11000;background-color:rgba(90,90,90,0.4);position:absolute;top:0;right:0;bottom:0;left:0}.up-modal-viewport{position:absolute;top:0;left:0;bottom:0;right:0;z-index:12000;overflow-x:hidden;overflow-y:scroll;text-align:center}.up-modal.up-modal-animating{overflow-y:scroll}.up-modal.up-modal-animating .up-modal-viewport{overflow-y:hidden}.up-modal-dialog{z-index:13000;position:relative;box-sizing:border-box;
|
1
|
+
[up-close]{cursor:pointer}.up-insertion{display:inline-block}[up-href]{cursor:pointer}.up-modal{position:fixed;top:0;left:0;bottom:0;right:0;z-index:10000;overflow-x:hidden}.up-modal-backdrop{z-index:11000;background-color:rgba(90,90,90,0.4);position:absolute;top:0;right:0;bottom:0;left:0}.up-modal-viewport{position:absolute;top:0;left:0;bottom:0;right:0;z-index:12000;overflow-x:hidden;overflow-y:scroll;text-align:center;padding:30px 10px}.up-modal.up-modal-animating{overflow-y:scroll}.up-modal.up-modal-animating .up-modal-viewport{overflow-y:hidden}.up-modal-dialog{z-index:13000;position:relative;box-sizing:border-box;max-width:100%;display:inline-block;text-align:left}.up-modal-content{z-index:14000;padding:20px;background-color:#fff;box-shadow:0 0 10px 1px rgba(0,0,0,0.3)}.up-modal-close{z-index:15000;position:absolute;right:0;top:0;width:36px;text-align:center;line-height:36px;height:36px;font-size:34px;color:#666;cursor:pointer}.up-modal[up-flavor='drawer'] .up-modal-viewport{text-align:left;padding:0}.up-modal[up-flavor='drawer'][up-position='right'] .up-modal-viewport{text-align:right}.up-modal[up-flavor='drawer'] .up-modal-dialog{max-width:350px}.up-modal[up-flavor='drawer'] .up-modal-content{min-height:100vh;box-sizing:border-box}.up-popup{z-index:20000;position:absolute;background-color:#fff;padding:15px;box-shadow:0 0 4px rgba(0,0,0,0.3)}.up-toast{border-top:3px solid #28b;background-color:white;color:#333;padding:10px;font-family:monospace;font-size:14px;line-height:15px;position:fixed;left:0;bottom:0;right:0;z-index:99999999}.up-toast-variable{font-weight:normal;color:#838383}.up-toast-actions{margin-top:7px}.up-toast-action{display:inline-block;word-spacing:-4px;text-decoration:underline;color:#28b;cursor:pointer}.up-toast-action+.up-toast-action{margin-left:12px}.up-tooltip{position:absolute;z-index:30000;background-color:#111;color:white;padding:6px 9px;white-space:nowrap;pointer-events:none}.up-tooltip:after{content:"";position:absolute;display:block;width:0;height:0;border:8px solid transparent}.up-tooltip[up-position=top]{margin-top:-6px}.up-tooltip[up-position=top]:after{border-top-color:#111;border-bottom-width:0;bottom:-8px;left:50%;margin-left:-8px}.up-tooltip[up-position=left]{margin-left:-6px}.up-tooltip[up-position=left]:after{border-left-color:#111;border-right-width:0;right:-8px;top:50%;margin-top:-8px}.up-tooltip[up-position=right]{margin-left:6px}.up-tooltip[up-position=right]:after{border-right-color:#111;border-left-width:0;left:-8px;top:50%;margin-top:-8px}.up-tooltip[up-position=bottom]{margin-top:6px}.up-tooltip[up-position=bottom]:after{border-bottom-color:#111;border-top-width:0;top:-8px;left:50%;margin-left:-8px}
|
data/dist/unpoly.min.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
(function(){var e;e="undefined"!=typeof global?global:this,e.up={version:"0.31.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,p,c,f,d,m,h,v,g,y,b,w,k,S,A,$,x,E,D,T,O,C,P,F,R,U,L,I,_,M,j,K,N,W,q,H,z,Q,J,V,B,X,G,Y,Z,ee,te,ne,re,oe,ie,ue,ae,se,le,pe,ce,fe,de,me,he,ve,ge,ye,be,we,ke,Se,Ae,$e,xe,Ee,De,Te,Oe,Ce,Pe,Fe,Re,Ue,Le,Ie,_e,Me,je,Ke,Ne,We,qe,He,ze,Qe,Je,Ve,Be,Xe,Ge,Ye,Ze,et,tt,nt,rt,ot,it,ut,at,st;return be=n.noop,de=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))}},oe=function(e,t){return t=t.toString(),(""===t||"80"===t)&&"http:"===e||"443"===t&&"https:"===e},ke=function(e,t){var n,r,o;return n=Ce(e),r=n.protocol+"//"+n.hostname,oe(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},Ce=function(e){var t;return t=null,ie(e)?(t=n("<a>").attr({href:e}).get(0),N(t.hostname)&&(t.href=t.href)):t=rt(e),t},we=function(e){return e?e.toUpperCase():"GET"},r=function(e){var t,r,o,i,u,a,s,l,p,c,f,d,m,h,v,g;for(v=e.split(/[ >]/),o=null,f=p=0,m=v.length;m>p;f=++p){for(a=v[f],u=a.match(/(^|\.|\#)[A-Za-z0-9\-_]+/g),g="div",i=[],c=null,d=0,h=u.length;h>d;d++)switch(s=u[d],s[0]){case".":i.push(s.substr(1));break;case"#":c=s.substr(1);break;default:g=s}l="<"+g,i.length&&(l+=' class="'+i.join(" ")+'"'),c&&(l+=' id="'+c+'"'),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),ne(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},Je=function(e){var t,r,o,i,u,a,s,l,p;if(t=n(e),l=void 0,up.puts("Creating selector from element %o",t.get(0)),p=Re(t.attr("up-id")))l="[up-id='"+p+"']";else if(i=Re(t.attr("id")))l="#"+i;else if(s=Re(t.attr("name")))l="[name='"+s+"']";else if(r=Re(ye(t)))for(l="",o=0,a=r.length;a>o;o++)u=r[o],l+="."+u;else l=t.prop("tagName").toLowerCase();return l},ye=function(e){var t,n;return t=e.attr("class")||"",n=t.split(" "),Qe(n,function(e){return ne(e)&&!e.match(/^up-/)})},w=function(e){var t,n,r,o,i,u,a,s,l,p,c,f;return l=function(e){return"<"+e+"(?: [^>]*)?>"},u=function(e){return"</"+e+">"},t="(?:.|\\s)*?",i=function(e){return"("+e+")"},f=new RegExp(l("title")+i(t)+u("title"),"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),(c=e.match(f))&&(a=b("head"),s.appendChild(a),p=b("title",c[1]),a.appendChild(p)),s):b("div",e)},O=n.extend,nt=n.trim,$=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},ce=$,Ze=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},Z=function(e){return null===e},ue=function(e){return void 0===e},q=function(e){return!ue(e)},Y=function(e){return ue(e)||Z(e)},B=function(e){return!Y(e)},N=function(e){return Y(e)||te(e)&&0===Object.keys(e).length||0===e.length},Re=function(e,t){return null==t&&(t=ne),t(e)?e:void 0},ne=function(e){return!N(e)},V=function(e){return"function"==typeof e},ie=function(e){return"string"==typeof e},ee=function(e){return"number"==typeof e},X=function(e){return"object"==typeof e&&!!e},te=function(e){return X(e)||"function"==typeof e},z=function(e){return!(!e||1!==e.nodeType)},G=function(e){return e instanceof jQuery},re=function(e){return te(e)&&V(e.then)},W=function(e){return re(e)&&V(e.resolve)},K=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},J=function(e){return up.browser.canFormData()&&e instanceof FormData},tt=function(e){return Array.prototype.slice.call(e)},g=function(e){return K(e)?e.slice():X(e)?O({},e):void 0},rt=function(e){return G(e)?e.get(0):e},me=function(){var t;return t=1<=arguments.length?e.call(arguments,0):[],O.apply(null,[{}].concat(e.call(t)))},Oe=function(e,t){var n,r,o,i;if(o=e?g(e):{},t)for(r in t)n=t[r],i=o[r],B(i)?te(n)&&te(i)&&(o[r]=Oe(i,n)):o[r]=n;return o},Te=function(){var t;return t=1<=arguments.length?e.call(arguments,0):[],S(t,B)},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,B)},ot=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=[],$(e,function(e){return t(e)?n.push(e):void 0}),n},_e=function(e,t){return Qe(e,function(e){return!t(e)})},j=function(e,t){return Qe(e,function(e){return v(t,e)})},Ue=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,ne)},Xe=function(e,t){return e>0?setTimeout(t,e):void t()},ge=function(e){return setTimeout(e,0)},le=function(e){return e[e.length-1]},d=function(){var e;return e=document.documentElement,{width:e.clientWidth,height:e.clientHeight}},ze=de(function(){var e,t,r;return e=n("<div>"),e.attr("up-viewport",""),e.css({position:"absolute",top:"0",left:"0",width:"100px",height:"100px",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},$e=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}},Ye=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()):$e(i)},L=function(e){var t,n;return n=e.css(["transform","-webkit-transform"]),N(n)||"none"===n.transform?(t=function(){return e.css(n)},e.css({transform:"translateZ(0)","-webkit-transform":"translateZ(0)"})):t=function(){},t},I=function(e){return e=rt(e),e.offsetHeight},k=function(e,t,r){var o,u,a,s,l,p,c,f;return o=n(e),r=Oe(r,{duration:300,delay:0,easing:"ease"}),0===r.duration?(o.css(t),qe()):(u=n.Deferred(),c=Object.keys(t),l={"transition-property":c.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"),p=function(){return o.removeClass("up-animating"),o.off("transitionend",s)},s=function(e){var t;return t=e.originalEvent.propertyName,v(c,t)?(u.resolve(),p()):void 0},o.on("transitionend",s),u.then(p),f=L(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?(I(o),o.css(a)):void 0}),u)},i="up-animation-deferred",R=function(e){return n(e).each(function(){var e;return(e=Pe(this,i))?e.resolve():void 0})},fe=function(e,t){var r,o,i,u,a;return t=Oe(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},F=function(e,t){return e.find(t).addBack(t)},E=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}},pe=function(e){return e.getResponseHeader("X-Up-Location")},et=function(e){return e.getResponseHeader("X-Up-Title")},he=function(e){return e.getResponseHeader("X-Up-Method")},xe=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},T=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},ae=function(e){return!(e.metaKey||e.shiftKey||e.ctrlKey)},se=function(e){var t;return t=ue(e.button)||0===e.button,t&&ae(e)},qe=function(){var e;return e=n.Deferred(),e.resolve(),e},He=function(){return qe().promise()},it=function(){return n.Deferred()},ut=function(){return it().promise()},Se=function(){return n()},We=function(){var t,r;return t=1<=arguments.length?e.call(arguments,0):[],r=n.when.apply(n,[qe()].concat(e.call(t))),r.resolve=de(function(){return $(t,function(e){return e.resolve()})}),r},Be=function(e,t){var n,r,o;r=[];for(n in t)o=t[n],Y(e.attr(n))?r.push(e.attr(n,o)):r.push(void 0);return r},Me=function(e,t){var n;return n=e.indexOf(t),n>=0?(e.splice(n,1),t):void 0},ve=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],ie(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=Se(),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||Se()},u},D=function(){var t,n;return n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],V(n)?n.apply(null,t):n},c=function(t){var n,r,o,i,u,a,s,l,p,c,f,d,m,h;return null==t&&(t={}),m=void 0,c=function(){return D(t.size)},o=function(){return D(t.expiry)},f=function(e){return t.key?t.key(e):e.toString()},u=function(){return 0!==c()&&0!==o()},r=function(){return m={}},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(m)},p=function(){var e,t,n,r;return r=g(s()),e=c(),e&&r.length>=e&&(t=null,n=null,$(r,function(e){var r,o;return r=m[e],o=r.timestamp,!n||n>o?(t=e,n=o):void 0}),t)?delete m[t]:void 0},n=function(e,t){var n;return n=i(e,{silent:!0}),q(n)?d(t,n):void 0},h=function(){return(new Date).valueOf()},d=function(e,t){var n;return u()?(p(),n=f(e),m[n]={timestamp:h(),value:t}):void 0},Me=function(e){var t;return t=f(e),delete m[t]},a=function(e){var t,n;return t=o(),t?(n=h()-e.timestamp,t>n):!0},i=function(e,t){var n,r;return null==t&&(t={}),r=f(e),(n=m[r])?a(n)?(t.silent||l("Cache hit for '%s'",e),n.value):(t.silent||l("Discarding stale cache entry for '%s'",e),void Me(e)):void(t.silent||l("Cache miss for '%s'",e))},{alias:n,get:i,set:d,remove:Me,clear:r,keys:s}},h=function(e){var t;return t=De(e),Object.preventExtensions(t),t},De=function(e){var t;return null==e&&(e={}),t={},t.reset=function(){var n;return n=e,V(n)&&(n=n()),O(t,n)},t.reset(),t},at=function(e){var t,n;return e=rt(e),t=e.parentNode,n=tt(e.childNodes),$(n,function(n){return t.insertBefore(n,e)}),t.removeChild(e)},Ae=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},Q=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=Ae(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:""})},je=function(e){var t,n,r,o,i,u,a;if(J(e))return up.fail("Cannot convert FormData into an array");for(u=Ke(e),t=[],a=u.split("&"),n=0,r=a.length;r>n;n++)i=a[n],ne(i)&&(o=i.split("="),t.push({name:decodeURIComponent(o[0]),value:decodeURIComponent(o[1])}));return t},Ke=function(e){var t;return J(e)?up.fail("Cannot convert FormData into a query string"):ne(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()},p=function(e,t,n){var r;return J(e)?e.append(t,n):K(e)?e.push({name:t,value:n}):te(e)?e[t]=n:(ie(e)||Y(e))&&(r=Ke([{name:t,value:n}]),e=ne(e)?[e,r].join("&"):r),e},P=function(){var t,n,r,o,i,u;throw t=1<=arguments.length?e.call(arguments,0):[],K(t[0])?(r=t[0],u=t[1]||{}):(r=t,u={}),(o=up.log).error.apply(o,r),st().then(function(){return up.toast.open(r,u)}),n=(i=up.browser).sprintf.apply(i,r),new Error(n)},a={"&":"&","<":"<",">":">",'"':"""},x=function(e){return e.replace(/[&<>"]/g,function(e){return a[e]})},Fe=function(e,t){var n;return n=e[t],delete e[t],n},Pe=function(e,t){var r,o;return r=n(e),o=r.data(t),r.removeData(t),o},C=function(e){var t;return t=le(e),X(t)&&!G(t)?e.pop():{}},Ee=function(e){var t;return t=n(e).css("opacity"),B(t)?parseFloat(t):void 0},st=de(function(){var e;return n.isReady?He():(e=n.Deferred(),n(function(){return e.resolve()}),e.promise())}),M=function(e){return e},H=function(e){return e=rt(e),!jQuery.contains(document.documentElement,e)},Le=function(t){var r,o;return r=n.Deferred(),o=function(){var n,o;return n=1<=arguments.length?e.call(arguments,0):[],o=t.apply(null,n),re(o)?o.then(function(){return r.resolve(o)}):r.resolve(o),o},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=ce(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=ce(t,Le),this.poke()},r}(),Ge=function(e){var t;return t=n(e),t.is("[type=checkbox], [type=radio]")&&!t.is(":checked")?void 0:t.val()},Ve=function(){var t;return t=1<=arguments.length?e.call(arguments,0):[],function(){return ce(t,function(e){return e()})}},Ie=function(e){var t,r;return t=n.Deferred(),r=Xe(e,function(){return t.resolve()}),t.cancel=function(){return clearTimeout(r)},t},_=function(e){var t,n,r,o;return t=fe(e),r=d(),n=t.left+.5*t.width,o=.5*r.width,o>n?"left":"right"},{isDetached:H,requestDataAsArray:je,requestDataAsQuery:Ke,appendRequestData:p,requestDataFromForm:Ne,offsetParent:Ae,fixedToAbsolute:U,isFixed:Q,presentAttr:Ue,createElement:b,parseUrl:Ce,normalizeUrl:ke,normalizeMethod:we,createElementFromHtml:w,$createElementFromSelector:r,$createPlaceholder:o,selectorForElement:Je,extend:O,copy:g,merge:me,options:Oe,option:Te,fail:P,each:$,map:ce,times:Ze,any:l,all:s,detect:S,select:Qe,reject:_e,intersect:j,compact:m,uniq:ot,last:le,isNull:Z,isDefined:q,isUndefined:ue,isGiven:B,isMissing:Y,isPresent:ne,isBlank:N,presence:Re,isObject:te,isFunction:V,isString:ie,isNumber:ee,isElement:z,isJQuery:G,isPromise:re,isDeferred:W,isHash:X,isArray:K,isFormData:J,isUnmodifiedKeyEvent:ae,isUnmodifiedMouseEvent:se,nullJQuery:Se,unJQuery:rt,setTimer:Xe,nextFrame:ge,measure:fe,temporaryCss:Ye,cssAnimate:k,finishCssAnimate:R,forceCompositing:L,forceRepaint:I,escapePressed:E,copyAttributes:y,findWithSelf:F,contains:v,toArray:tt,castedAttr:f,locationFromXhr:pe,titleFromXhr:et,methodFromXhr:he,clientSize:d,only:xe,except:T,trim:nt,unresolvableDeferred:it,unresolvablePromise:ut,resolvedPromise:He,resolvedDeferred:qe,resolvableWhen:We,setMissingAttrs:Be,remove:Me,memoize:de,scrollbarWidth:ze,documentHasVerticalScrollbar:A,config:h,openConfig:De,cache:c,unwrapElement:at,multiSelector:ve,error:P,pluckData:Pe,pluckKey:Fe,extractOptions:C,isDetached:H,noop:be,opacity:Ee,whenReady:st,identity:M,escapeHtml:x,DivertibleChain:u,submittedValue:Ge,sequence:Ve,promiseTimer:Ie,previewable:Le,evalOption:D,horizontalScreenHalf:_}}($),up.fail=up.util.fail}.call(this),function(){var slice=[].slice;up.browser=function($){var CONSOLE_PLACEHOLDERS,canCssTransition,canFormData,canInputEvent,canLogSubstitution,canPushState,initialRequestMethod,installPolyfills,isIE8OrWorse,isIE9OrWorse,isRecentJQuery,isSupported,loadPage,popCookie,puts,sessionStorage,setLocationHref,sprintf,sprintfWithFormattedArgs,stringifyArg,submitForm,u,url,whenConfirmed;return u=up.util,loadPage=function(e,t){var n,r,o,i,a;return null==t&&(t={}),i=u.option(t.method,"get").toLowerCase(),"get"===i?(a=u.requestDataAsQuery(t.data),a&&(e=e+"?"+a),setLocationHref(e)):(n=$("<form method='post' action='"+e+"' class='up-page-loader'></form>"),r=function(e){var t;return t=$('<input type="hidden">'),t.attr(e),t.appendTo(n)},r({name:up.proxy.config.wrapMethodParam,value:i}),(o=up.rails.csrfField())&&r(o),u.each(u.requestDataAsArray(t.data),r),n.hide().appendTo("body"),submitForm(n))},submitForm=function(e){return e.submit()},setLocationHref=function(e){return location.href=e},puts=function(){var e,t,n;return n=arguments[0],e=2<=arguments.length?slice.call(arguments,1):[],canLogSubstitution()?console[n].apply(console,e):(t=sprintf.apply(null,e),console[n](t))},CONSOLE_PLACEHOLDERS=/\%[odisf]/g,stringifyArg=function(e){var t,n,r,o,i,a,s,l,p;if(a=200,r="",u.isString(e))l=e.replace(/[\n\r\t ]+/g," "),l=l.replace(/^[\n\r\t ]+/,""),l=l.replace(/[\n\r\t ]$/,""),l='"'+l+'"',r='"';else if(u.isUndefined(e))l="undefined";else if(u.isNumber(e)||u.isFunction(e))l=e.toString();else if(u.isArray(e))l="["+u.map(e,stringifyArg).join(", ")+"]",r="]";else if(u.isJQuery(e))l="$("+u.map(e,stringifyArg).join(", ")+")",r=")";else if(u.isElement(e)){for(t=$(e),l="<"+e.tagName.toLowerCase(),s=["id","name","class"],o=0,i=s.length;i>o;o++)n=s[o],(p=t.attr(n))&&(l+=" "+n+'="'+p+'"');l+=">",r=">"}else l=JSON.stringify(e);return l.length>a&&(l=l.substr(0,a)+" \u2026",l+=r),l},sprintf=function(){var e,t;return t=arguments[0],e=2<=arguments.length?slice.call(arguments,1):[],sprintfWithFormattedArgs.apply(null,[u.identity,t].concat(slice.call(e)))},sprintfWithFormattedArgs=function(){var e,t,n,r;return t=arguments[0],r=arguments[1],e=3<=arguments.length?slice.call(arguments,2):[],u.isBlank(r)?"":(n=0,r.replace(CONSOLE_PLACEHOLDERS,function(){var r;return r=e[n],r=t(stringifyArg(r)),n+=1,r}))},url=function(){return location.href},isIE8OrWorse=u.memoize(function(){return u.isUndefined(document.addEventListener)}),isIE9OrWorse=u.memoize(function(){return isIE8OrWorse()||-1!==navigator.appVersion.indexOf("MSIE 9.")}),canPushState=u.memoize(function(){return u.isDefined(history.pushState)&&"get"===initialRequestMethod()}),canCssTransition=u.memoize(function(){return"transition"in document.documentElement.style}),canInputEvent=u.memoize(function(){return"oninput"in document.createElement("input")}),canFormData=u.memoize(function(){return!!window.FormData}),canLogSubstitution=u.memoize(function(){return!isIE9OrWorse()}),isRecentJQuery=u.memoize(function(){var e,t,n,r;return r=$.fn.jquery,n=r.split("."),e=parseInt(n[0]),t=parseInt(n[1]),e>=2||1===e&&t>=9}),popCookie=function(e){var t,n;return n=null!=(t=document.cookie.match(new RegExp(e+"=(\\w+)")))?t[1]:void 0,u.isPresent(n)&&(document.cookie=e+"=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/"),n},whenConfirmed=function(e){return e.preload||u.isBlank(e.confirm)||window.confirm(e.confirm)?u.resolvedPromise():u.unresolvablePromise()},initialRequestMethod=u.memoize(function(){return(popCookie("_up_request_method")||"get").toLowerCase()}),isSupported=function(){return!isIE8OrWorse()&&isRecentJQuery()},installPolyfills=function(){var e,t,n,r;for(null==window.console&&(window.console={}),r=["debug","info","warn","error","group","groupCollapsed","groupEnd"],e=0,t=r.length;t>e;e++)n=r[e],null==console[n]&&(console[n]=function(){var e;return e=1<=arguments.length?slice.call(arguments,0):[],puts.apply(null,["log"].concat(slice.call(e)))});return null!=console.log?console.log:console.log=u.noop},sessionStorage=u.memoize(function(){return window.sessionStorage||{getItem:u.noop,setItem:u.noop,removeItem:u.noop}}),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),url:url,loadPage:loadPage,whenConfirmed:whenConfirmed,canPushState:canPushState,canCssTransition:canCssTransition,canInputEvent:canInputEvent,canFormData:canFormData,canLogSubstitution:canLogSubstitution,isSupported:isSupported,installPolyfills:installPolyfills,puts:puts,sprintf:sprintf,sprintfWithFormattedArgs:sprintfWithFormattedArgs,sessionStorage:sessionStorage}}(jQuery)}.call(this),function(){var slice=[].slice;up.bus=function($){var boot,consumeAction,emit,emitReset,forgetUpDescription,haltEvent,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||up.fail("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,n!==!1&&(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})},haltEvent=function(e){return e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault()},consumeAction=function(e){return haltEvent(e),"up:action:consumed"!==e.type?emit("up:action:consumed",{$element:$(e.target),message:!1}):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,haltEvent:haltEvent,consumeAction:consumeAction,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,p,c,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()},p=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",p(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",p(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",p(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,p(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",p(n)].concat(e.call(t))):void 0},c=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",c),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.toast=function(t){var n,r,o,i,u,a,s,l,p,c;return c=up.util,o=up.browser,n=function(e){return"<span class='up-toast-variable'>"+c.escapeHtml(e)+"</span>"},p=c.config({$toast:null}),l=function(){return i(),p.reset()},a=function(t){return c.isArray(t)?(t[0]=c.escapeHtml(t[0]),t=o.sprintfWithFormattedArgs.apply(o,[n].concat(e.call(t)))):t=c.escapeHtml(t),t},u=function(){return!!p.$toast},r=function(e,n,r){var o;return o=t('<span class="up-toast-action"></span>').text(n),o.on("click",r),o.appendTo(e)},s=function(e,n){var o,u,s,l;return null==n&&(n={}),i(),s=t('<div class="up-toast"></div>').prependTo("body"),u=t('<div class="up-toast-message"></div>').appendTo(s),o=t('<div class="up-toast-actions"></div>').appendTo(s),e=a(e),u.html(e),(l=n.action||n.inspect)&&r(o,l.label,l.callback),r(o,"Close",i),p.$toast=s},i=function(){return u()?(p.$toast.remove(),p.$toast=null):void 0},up.on("up:framework:reset",l),{open:s,close:i,reset:l,isOpen:u}}(jQuery)}.call(this),function(){var e=[].slice;up.syntax=function(t){var n,r,o,i,u,a,s,l,p,c,f,d,m,h,v,g,y;return y=up.util,n="up-destructable",r="up-destructors",p=[],h=[],l=function(){var t;return t=1<=arguments.length?e.call(arguments,0):[],d.apply(null,[p].concat(e.call(t)))},m=function(){var t;return t=1<=arguments.length?e.call(arguments,0):[],d.apply(null,[h].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=y.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}},d=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,u,a,s,l,p;for(up.puts(e.isDefault?void 0:"Compiling '%s' on %o",e.selector,n),e.keep&&(p=y.isString(e.keep)?e.keep:"",t.attr("up-keep",p)),l=e.callback.apply(n,[t,c(t)]),a=f(l),s=[],i=0,u=a.length;u>i;i++)r=a[i],s.push(o(t,r));return s},f=function(e){return y.isFunction(e)?[e]:y.isArray(e)&&y.all(e,y.isFunction)?e:[]},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=y.options(n),r=t(n.skip),up.log.group("Compiling fragment %o",e.get(0),function(){var n,o,u,a,s,c;for(s=[h,p],c=[],o=0,u=s.length;u>o;o++)a=s[o],c.push(function(){var o,u,s;for(s=[],o=0,u=a.length;u>o;o++)l=a[o],n=y.findWithSelf(e,l.selector),n=n.filter(function(){var e;return e=t(this),y.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 c})},a=function(e){return y.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)})},c=function(e){var n,r;return n=t(e),r=n.attr("up-data"),y.isString(r)&&""!==y.trim(r)?JSON.parse(r):{}},g=function(){var e;return e=function(e){return e.isDefault=!0},y.each(p,e),y.each(h,e)},v=function(){var e;return e=function(e){return e.isDefault},p=y.select(p,e),h=y.select(h,e)},up.on("up:framework:booted",g),up.on("up:framework:reset",v),{compiler:l,macro:m,compile:s,clean:a,data:c}}(jQuery),up.compiler=up.syntax.compiler,up.macro=up.syntax.macro}.call(this),function(){up.history=function(e){var t,n,r,o,i,u,a,s,l,p,c,f,d,m,h,v;return v=up.util,n=v.config({popTargets:["body"],restoreScroll:!0}),p=void 0,u=void 0,m=function(){return n.reset(),p=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&&(p=u,u=void 0),u=e},d=function(e){return i("replaceState",e)},c=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())):up.fail("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:p}),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(p)?(v.setMissingAttrs(e,{"up-href":p,"up-restore-scroll":""}),e.removeAttr("up-back"),up.link.makeFollowable(e)):void 0}),up.on("up:framework:reset",m),{config:n,defaults:function(){return up.fail("up.history.defaults(...) no longer exists. Set values on he up.history.config property instead.")},push:c,replace:d,url:r,previousUrl:function(){return p},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,
|
2
|
-
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)||up.fail("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,p,c,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(),c=r.scrollTop(),s=c,p=void 0,l=void 0,v?(l=measureObstruction(),p=0):(l={top:0,bottom:0},p=c),f=function(){return s+l.top},d=function(){return s+h-l.bottom-1},o=u.measure(n,{relative:r}),i=o.top+p,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!==c?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&&up.fail("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},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 up.fail("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)):up.fail("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},n.inspectResponse=function(){return up.browser.loadPage(t,u.only(n,"method","data"))},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,p;return i.method=u.normalizeMethod(u.option(u.methodFromXhr(o),i.method)),a="GET"===i.method,(p=u.locationFromXhr(o))?(n=p,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;return t=findOldFragment(u.selector,n),e=o.first(u.selector),t&&e?(filterScripts(e,n),r=swapElements(t,e,u.pseudoClass,u.transition,n),a.push(r),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)"),up.fail(r,e)):void 0},filterScripts=function(e,t){var n,r,o,i,a,s,l,p,c,f;for(p=u.option(t.runInlineScripts,config.runInlineScripts),c=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&&c||o&&p?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},first:function(r){var o,i;return(o=$.find(r,n)[0])?$(o):t.requireMatch?(i={label:"Open response",callback:t.inspectResponse},up.fail(["Could not find selector %s in response %o",r,e],{action:i})):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,p,c;if(a=[],n.keep)for(c=e.find("[up-keep]"),i=0,l=c.length;l>i;i++)s=c[i],r=$(s),(p=findKeepPlan(r,t,u.merge(n,{descendantsOnly:!0})))&&(o=r.clone(),r.replaceWith(o),p.$newElement.replaceWith(r),a.push(p));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,p,c,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)p=r[o],c=p.match(/^(.+?)(?:\:(before|after))?$/),c||up.fail('Could not parse selector atom "%s"',p),e=c[1],"html"===e&&(e="body"),s=c[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,p,c,f,d,m,h,v,g,y,b,w,k,S,A,$,x,E,D,T,O;return T=up.util,a={},p={},E={},c={},l=T.config({duration:300,delay:0,easing:"ease",enabled:!0}),k=function(){return m(),a=T.copy(p),E=T.copy(c),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||T.isMissing(n)?b():T.isFunction(n)?s(n(u,r),n):T.isString(n)?o(u,d(n),r):T.isHash(n)?v()?T.cssAnimate(u,n,r):(u.css(n),T.resolvedDeferred()):up.fail("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=T.isJQuery(n[0])?n.shift():T.nullJQuery(),o=T.isObject(n[0])?n.shift():{},r={},r.easing=T.option(i.easing,T.presentAttr(t,"up-easing"),o.easing,l.easing),r.duration=Number(T.option(i.duration,T.presentAttr(t,"up-duration"),o.duration,l.duration)),r.delay=Number(T.option(i.delay,T.presentAttr(t,"up-delay"),o.delay,l.delay)),r},d=function(e){return a[e]||up.fail("Unknown animation %o",e)},r="up-ghosting-deferred",n="up-ghosting",O=function(e,t,o,i){var u,a,s,l,p,c,f,d;return o.copy===!1||e.is(".up-ghost")||t.is(".up-ghost")?i(e,t):(c=void 0,l=void 0,f=void 0,p=void 0,a=up.layout.viewportOf(e),u=e.add(t),T.temporaryCss(t,{display:"none"},function(){return c=w(e,a),f=a.scrollTop()}),T.temporaryCss(e,{display:"none"},function(){return up.layout.revealOrRestoreScroll(t,o),l=w(t,a),p=a.scrollTop()}),c.moveTop(p-f),e.hide(),d=T.temporaryCss(t,{opacity:"0"}),s=i(c.$ghost,l.$ghost),u.data(r,s),u.addClass(n),s.then(function(){return u.removeData(r),u.removeClass(n),d(),c.$bounds.remove(),l.$bounds.remove()}),s)},m=function(e){var r,o,i;return null==e&&(e=".up-animating"),o=t(e),r=T.findWithSelf(o,".up-animating"),T.finishCssAnimate(r),i=T.findWithSelf(o,"."+n),h(i)},h=function(e){return e.each(function(){var e,n;return e=t(this),(n=T.pluckData(e,r))?n.resolve():void 0})},s=function(e,t){return T.isDeferred(e)?e:up.fail("Did not return a promise with .then and .resolve methods: %o",t)},y=function(e,n,r,u){var l,p;return"none"===r&&(r=!1),u=T.options(u),p=t(e),l=t(n),f(p,r),f(l,r),up.log.group(r?"Morphing %o to %o (using %s, %o)":void 0,p.get(0),l.get(0),r,u,function(){var e,t,n,c;return t=T.only(u,"reveal","restoreScroll","source"),t=T.extend(t,i(u)),v()?(m(p),m(l),r?(e=a[r])?(A(p,l,t),o(l,e,t)):(c=T.presence(r,T.isFunction)||E[r])?O(p,l,t,function(e,n){var o;return o=c(e,n,t),s(o,r)}):T.isString(r)&&r.indexOf("/")>=0?(n=r.split("/"),c=function(e,t,r){return S(o(e,n[0],r),o(t,n[1],r))},y(p,l,c,t)):up.fail("Unknown transition %o",r):A(p,l,t)):A(p,l,t)})},f=function(e,t){var n;return t&&0===e.parents("body").length?(n=e.get(0),up.fail("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,p,c;for(u=T.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),c=u.top,p=function(e){return 0!==e?(c+=e,r.css({top:c})):void 0},i.appendTo(r),r.insertBefore(e),p(e.offset().top-i.offset().top),o=up.layout.fixedChildren(i),s=0,l=o.length;l>s;s++)a=o[s],T.fixedToAbsolute(a,n);return{$ghost:i,$bounds:r,moveTop:p}},x=function(e,t){return E[e]=t},u=function(e,t){return a[e]=t},$=function(){return p=T.copy(a),c=T.copy(E)},S=T.resolvableWhen,b=T.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)}),D=function(e,t){return{transform:"translate("+e+"px, "+t+"px)"}},u("move-to-top",function(e,t){var n,r;return n=T.measure(e),r=n.top+n.height,e.css(D(0,0)),o(e,D(0,-r),t)}),u("move-from-top",function(e,t){var n,r;return n=T.measure(e),r=n.top+n.height,e.css(D(0,-r)),o(e,D(0,0),t)}),u("move-to-bottom",function(e,t){var n,r;return n=T.measure(e),r=T.clientSize().height-n.top,e.css(D(0,0)),o(e,D(0,r),t)}),u("move-from-bottom",function(e,t){var n,r;return n=T.measure(e),r=T.clientSize().height-n.top,e.css(D(0,r)),o(e,D(0,0),t)}),u("move-to-left",function(e,t){var n,r;return n=T.measure(e),r=n.left+n.width,e.css(D(0,0)),o(e,D(-r,0),t)}),u("move-from-left",function(e,t){var n,r;return n=T.measure(e),r=n.left+n.width,e.css(D(-r,0)),o(e,D(0,0),t)}),u("move-to-right",function(e,t){var n,r;return n=T.measure(e),r=T.clientSize().width-n.left,e.css(D(0,0)),o(e,D(r,0),t)}),u("move-from-right",function(e,t){var n,r;return n=T.measure(e),r=T.clientSize().width-n.left,e.css(D(r,0)),o(e,D(0,0),t)}),u("roll-down",function(e,t){var n,r,i;return r=e.height(),i=T.temporaryCss(e,{height:"0px",overflow:"hidden"}),n=o(e,{height:r+"px"},t),n.then(i),n}),x("none",b),x("move-left",function(e,t,n){return S(o(e,"move-to-left",n),o(t,"move-from-right",n))}),x("move-right",function(e,t,n){return S(o(e,"move-to-right",n),o(t,"move-from-left",n))}),x("move-up",function(e,t,n){return S(o(e,"move-to-top",n),o(t,"move-from-bottom",n))}),x("move-down",function(e,t,n){return S(o(e,"move-to-bottom",n),o(t,"move-from-top",n))}),x("cross-fade",function(e,t,n){return S(o(e,"fade-out",n),o(t,"fade-in",n))}),up.on("up:framework:booted",$),up.on("up:framework:reset",k),{morph:y,animate:o,animateOptions:i,finish:m,transition:x,animation:u,config:l,isEnabled:v,defaults:function(){return up.fail("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,p,c,f,d,m,h,v,g,y,b,w,k,S,A,$,x,E,D,T,O,C,P,F,R,U,L;return L=up.util,n=void 0,x=void 0,F=void 0,S=void 0,R=void 0,D=[],c=L.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,L.requestDataAsQuery(e.data),e.target].join("|")},i=L.cache({size:function(){return c.cacheSize},expiry:function(){return c.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=L.merge(e,{target:"html"}),n.push(a),"body"!==e.target&&(u=L.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(x),x=null},s=function(){return clearTimeout(F),F=null},O=function(){return n=null,a(),s(),S=0,c.reset(),i.clear(),R=!1,D=[]},O(),k=function(e){return e._normalized||(e.method=L.normalizeMethod(e.method),e.url&&(e.url=L.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=L.extractOptions(t),L.isGiven(t[0])&&(o.url=t[0]),n=o.cache===!0,r=o.cache===!1,a=L.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),P(a,u),u.fail(function(){return T(a)})):(p(),u=b(a)),i&&!o.preload&&(w(),u.always(y)),u},m=function(e){return!L.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"}),R=!0):void 0},F=L.setTimer(c.slowDelay,e)):void 0},y=function(){return S-=1,v()&&R?(up.emit("up:proxy:recover",{message:"Proxy is idle"}),R=!1):void 0},b=function(e){return S<c.maxRequests?g(e):E(e)},E=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},D.push(r),n.promise()},g=function(e){var n;return up.emit("up:proxy:load",L.merge(e,{message:["Loading %s %s",e.method,e.url]})),e=L.copy(e),e.headers||(e.headers={}),e.headers["X-Up-Target"]=e.target,L.contains(c.wrapMethods,e.method)&&(e.data=L.appendRequestData(e.data,c.wrapMethodParam,e.method),e.method="POST"),L.isFormData(e.data)&&(e.contentType=!1,e.processData=!1),n=t.ajax(e),n.done(function(t,n,r){return C(e,r)}),n.fail(function(t,n,r){return C(e,t)}),n},C=function(e,t){var n;return up.emit("up:proxy:received",L.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=D.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,P=i.set,T=i.remove,p=i.clear,h=function(e){return k(e),L.contains(c.safeMethods,e.method)},l=function(e){var t,r;return r=parseInt(L.presentAttr(e,"up-delay"))||c.preloadDelay,e.is(n)?void 0:(n=e,a(),t=function(){return $(e),n=null},U(t,r))},U=function(e,t){return x=setTimeout(e,t)},$=function(e,n){var r,o;return r=t(e),n=L.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),L.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",O),{preload:$,ajax:r,get:f,alias:o,clear:p,remove:T,isIdle:v,isBusy:d,isCachable:m,config:c,defaults:function(){return up.fail("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.start(e,function(){return t(e)})},up.on("click","a"+e+", [up-href]"+e,function(e,t){return shouldProcessLinkEvent(e,t)?t.is("[up-instant]")?up.bus.haltEvent(e):(up.bus.consumeAction(e),n(t)):allowDefault(e)}),up.on("mousedown","a"+e+"[up-instant], [up-href]"+e+"[up-instant]",function(e,t){return shouldProcessLinkEvent(e,t)?(up.bus.consumeAction(e),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,p,c;if(t=e.find("a, [up-href]"),(p=e.attr("up-expand"))&&(t=t.filter(p)),i=t.get(0)){for(c=/^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(c)&&(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,observeField,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.start(n),r&&o?(a=up.replace(s,l,t),a.always(function(){return up.navigation.stop(n)}),a):(n.get(0).submit(),u.unresolvablePromise()))},observe=function(){var $element,$fields,callback,callbackArg,delay,destructors,extraArgs,options,rawCallback,selectorOrElement;return selectorOrElement=arguments[0],extraArgs=2<=arguments.length?slice.call(arguments,1):[],options={},callbackArg=void 0,1===extraArgs.length?callbackArg=extraArgs[0]:extraArgs.length>1&&(options=u.options(extraArgs[0]),callbackArg=extraArgs[1]),$element=$(selectorOrElement),$fields=u.multiSelector(config.fields).findWithSelf($element),callback=null,rawCallback=u.option(callbackArg,u.presentAttr($fields,"up-observe")),callback=u.isString(rawCallback)?function(value,$field){return eval(rawCallback)}:rawCallback||up.fail("up.observe: No change callback given"),delay=u.option($fields.attr("up-delay"),options.delay,config.observeDelay),delay=parseInt(delay),destructors=u.map($fields,function(e){return observeField($(e),delay,callback)}),u.sequence.apply(u,destructors)},observeField=function(e,t,n){var r,o,i,a,s,l;return a=u.submittedValue(e),l=void 0,i=u.resolvedPromise(),s=function(t){var r;return a=t,r=n.apply(e.get(0),[t,e]),i=u.isPromise(r)?r:r},o=function(){var n,r;return r=u.submittedValue(e),a!==r?(n=function(){return s(r)},null!=l&&l.cancel(),l=u.promiseTimer(t),$.when(l,i).then(n)):void 0},r="input change",up.browser.canInputEvent()||(r+=" keypress paste cut click propertychange"),e.on(r,o),function(){return e.off(r,o),null!=l?l.cancel():void 0}},autosubmit=function(e,t){return observe(e,t,function(e,t){var n;return n=t.closest("form"),up.navigation.start(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)&&up.fail("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)||up.fail("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 up.bus.consumeAction(e),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,autosubmit:autosubmit}}(jQuery),up.submit=up.form.submit,up.observe=up.form.observe,up.autosubmit=up.form.autosubmit,up.validate=up.form.validate}.call(this),
|
3
|
-
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:up.fail("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||up.fail("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)},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("click up:action:consumed",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(),up.bus.consumeAction(e)):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,flavors,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",closable:!0,sticky:!1,flavor:"default",position:null,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>'+e.closeLabel+"</div>\n </div>\n </div>\n</div>"}}),flavors=u.openConfig({"default":{}}),state=u.config(function(){return{phase:"closed",$anchor:null,$modal:null,sticky:null,closable:null,flavor:null,url:null,coveredUrl:null,coveredTitle:null,position:null,unshifters:[]}}),chain=new u.DivertibleChain,reset=function(){var e;return null!=(e=state.$modal)&&e.remove(),unshiftElements(),state.reset(),chain.reset(),config.reset(),flavors.reset()},templateHtml=function(){var e;return e=flavorDefault("template"),u.evalOption(e,{closeLabel:flavorDefault("closeLabel")})},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),u.isPresent(state.position)&&o.attr("up-position",state.position),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),state.closable||o.find(".up-modal-close").remove(),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"),config.flavor),e.position=u.option(e.position,t.attr("up-position"),flavorDefault("position",e.flavor)),e.position=u.evalOption(e.position,{$link:t}),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.animation=u.evalOption(e.animation,{position:e.position}),e.backdropAnimation=u.option(e.backdropAnimation,t.attr("up-backdrop-animation"),flavorDefault("backdropOpenAnimation",e.flavor)),e.backdropAnimation=u.evalOption(e.backdropAnimation,{position:e.position}),e.sticky=u.option(e.sticky,u.castedAttr(t,"up-sticky"),flavorDefault("sticky",e.flavor)),e.closable=u.option(e.closable,u.castedAttr(t,"up-closable"),flavorDefault("closable",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.closable=e.closable,state.position=e.position,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")),o=u.evalOption(o,{position:state.position}),n=u.option(e.backdropAnimation,flavorDefault("backdropCloseAnimation")),n=u.evalOption(n,{position:state.position}),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,state.closable=null,state.position=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={}),up.log.warn("The up.modal.flavor function is deprecated. Use the up.modal.flavors property instead."),u.extend(flavorOverrides(e),t)},flavorOverrides=function(e){return flavors[e]||(flavors[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",function(e){var t;if(state.closable)return t=$(e.target),t.closest(".up-modal-dialog").length||t.closest("[up-modal]").length?void 0:(up.bus.consumeAction(e),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(function(){return state.closable?closeAsap():void 0}),up.on("click","[up-close]",function(e,t){return contains(t)?(closeAsap(),up.bus.consumeAction(e)):void 0}),up.macro("[up-drawer]",function(e){var t;return t=e.attr("up-drawer"),e.attr({"up-modal":t,"up-flavor":"drawer"})}),flavors.drawer={openAnimation:function(e){switch(e.position){case"left":return"move-from-left";case"right":return"move-from-right"}},closeAnimation:function(e){switch(e.position){case"left":return"move-to-left";case"right":return"move-to-right"}},position:function(e){return u.isPresent(e.$link)?u.horizontalScreenHalf(e.$link):"left"}},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,flavors:flavors,contains:contains,isOpen:isOpen,flavor:flavor}}(jQuery)}.call(this),function(){up.tooltip=function(e){var t,n,r,o,i,u,a,s,l,p,c,f;return f=up.util,a=f.config({position:"top",openAnimation:"fade-in",closeAnimation:"fade-out",openDuration:100,closeDuration:50,openEasing:null,closeEasing:null}),c=f.config({phase:"closed",$anchor:null,$tooltip:null,position:null}),o=new f.DivertibleChain,p=function(){var e;return null!=(e=c.$tooltip)&&e.remove(),c.reset(),o.reset(),a.reset()},t=function(){var e,t,n;switch(e={},n=f.measure(c.$tooltip),f.isFixed(c.$anchor)?(t=c.$anchor.get(0).getBoundingClientRect(),e.position="fixed"):t=f.measure(c.$anchor),c.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:up.fail("Unknown position option '%s'",c.position)}return c.$tooltip.attr("up-position",c.position),c.$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),c.$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,p,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")),p=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}),c.phase="opening",c.$anchor=o,s({text:d,html:l}),c.position=p,t(),up.animate(c.$tooltip,u,i).then(function(){return c.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),c.phase="closing",up.destroy(c.$tooltip,e).then(function(){return c.phase="closed",c.$tooltip=null,c.$anchor=null})):f.resolvedPromise()},l=function(){return"opening"===c.phase||"opened"===c.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 up:action:consumed",function(e){return i()}),up.on("up:framework:reset",p),up.bus.onEscape(function(){return i()}),{config:a,attach:n,isOpen:l,close:i}}(jQuery)}.call(this),function(){up.navigation=function(e){var t,n,r,o,i,u,a,s,l,p,c,f,d;return f=up.util,r=f.config({currentClasses:["up-current"]}),s=function(){return r.reset()},o=function(){var e;return e=r.currentClasses,e=e.concat(["up-current"]),e=f.uniq(e),e.join(" ")},t="up-active",n="a, [up-href]",a=function(e){return f.isPresent(e)?f.normalizeUrl(e):void 0},l=function(e){var t,n,r,o,i,u,s,l,p,c;for(l=[],u=["href","up-href","up-alias"],n=0,o=u.length;o>n;n++)if(t=u[n],p=f.presentAttr(e,t))for(c="up-alias"===t?p.split(" "):[p],r=0,i=c.length;i>r;r++)s=c[r],"#"!==s&&(s=a(s),l.push(s));return l},d=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}},u=function(){var t,r;return t=d([a(up.browser.url()),a(up.modal.url()),a(up.modal.coveredUrl()),a(up.popup.url()),a(up.popup.coveredUrl())]),r=o(),f.each(e(n),function(n){var o,i;return o=e(n),i=l(o),t.matchesAny(i)?o.addClass(r):o.hasClass(r)&&0===o.closest(".up-destroying").length?o.removeClass(r):void 0})},i=function(t){var r;return r=e(t),r.is(n)&&(r=f.presence(r.parent(n))||r),r},p=function(e,n){var r,o;return r=i(e),r.addClass(t),n?(o=n(),f.isPromise(o)?o.always(function(){return c(r)}):up.warn("Expected block to return a promise, but got %o",o),o):void 0},c=function(e){var n;return n=i(e),up.emit("up:navigated",{$element:n,message:!1}),n.removeClass(t)},up.on("up:fragment:inserted",function(){return u()}),up.on("up:fragment:destroyed",function(e,t){return t.is(".up-modal, .up-popup")?u():void 0}),up.on("up:framework:reset",s),{config:r,defaults:function(){return up.fail("up.navigation.defaults(...) no longer exists. Set values on he up.navigation.config property instead.")},start:p,stop:c}}(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(){var e;e="undefined"!=typeof global?global:this,e.up={version:"0.32.0"}}).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,p,c,f,d,h,m,v,g,y,b,w,k,S,A,$,x,E,D,T,O,C,P,F,R,U,L,I,_,M,j,K,N,W,H,q,z,Q,J,V,B,X,G,Y,Z,ee,te,ne,re,oe,ie,ue,ae,se,le,pe,ce,fe,de,he,me,ve,ge,ye,be,we,ke,Se,Ae,$e,xe,Ee,De,Te,Oe,Ce,Pe,Fe,Re,Ue,Le,Ie,_e,Me,je,Ke,Ne,We,He,qe,ze,Qe,Je,Ve,Be,Xe,Ge,Ye,Ze,et,tt,nt,rt,ot,it,ut,at,st,lt;return we=n.noop,he=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))}},ie=function(e,t){return t=t.toString(),(""===t||"80"===t)&&"http:"===e||"443"===t&&"https:"===e},Se=function(e,t){var n,r,o;return n=Pe(e),r=n.protocol+"//"+n.hostname,ie(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},Pe=function(e){var t;return t=null,ue(e)?(t=n("<a>").attr({href:e}).get(0),W(t.hostname)&&(t.href=t.href)):t=ot(e),t},ke=function(e){return e?e.toUpperCase():"GET"},r=function(e){var t,r,o,i,u,a,s,l,p,c,f,d,h,m,v,g;for(v=e.split(/[ >]/),o=null,f=p=0,h=v.length;p<h;f=++p){for(a=v[f],u=a.match(/(^|\.|\#)[A-Za-z0-9\-_]+/g),g="div",i=[],c=null,d=0,m=u.length;d<m;d++)switch(s=u[d],s[0]){case".":i.push(s.substr(1));break;case"#":c=s.substr(1);break;default:g=s}l="<"+g,i.length&&(l+=' class="'+i.join(" ")+'"'),c&&(l+=' id="'+c+'"'),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),re(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},Ve=function(e){var t,r,o,i,u,a,s,l,p;if(t=n(e),l=void 0,up.puts("Creating selector from element %o",t.get(0)),p=Ue(t.attr("up-id")))l="[up-id='"+p+"']";else if(i=Ue(t.attr("id")))l="#"+i;else if(s=Ue(t.attr("name")))l="[name='"+s+"']";else if(r=Ue(be(t)))for(l="",o=0,a=r.length;o<a;o++)u=r[o],l+="."+u;else l=t.prop("tagName").toLowerCase();return l},be=function(e){var t,n;return t=e.attr("class")||"",n=t.split(" "),Je(n,function(e){return re(e)&&!e.match(/^up-/)})},w=function(e){var t,n,r,o,i,u,a,s,l,p,c,f;return l=function(e){return"<"+e+"(?: [^>]*)?>"},u=function(e){return"</"+e+">"},t="(?:.|\\s)*?",i=function(e){return"("+e+")"},f=new RegExp(l("title")+i(t)+u("title"),"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),(c=e.match(f))&&(a=b("head"),s.appendChild(a),p=b("title",c[1]),a.appendChild(p)),s):b("div",e)},C=n.extend,rt=n.trim,x=function(e,t){var n,r,o,i,u;for(u=[],r=n=0,i=e.length;n<i;r=++n)o=e[r],u.push(t(o,r));return u},fe=x,et=function(e,t){var n,r,o,i;for(i=[],r=n=0,o=e-1;0<=o?n<=o:n>=o;r=0<=o?++n:--n)i.push(t(r));return i},ee=function(e){return null===e},ae=function(e){return void 0===e},q=function(e){return!ae(e)},Z=function(e){return ae(e)||ee(e)},X=function(e){return!Z(e)},W=function(e){return Z(e)||ne(e)&&0===Object.keys(e).length||0===e.length},Ue=function(e,t){return null==t&&(t=re),t(e)?e:void 0},re=function(e){return!W(e)},B=function(e){return"function"==typeof e},ue=function(e){return"string"==typeof e},te=function(e){return"number"==typeof e},G=function(e){return"object"==typeof e&&!!e},ne=function(e){return G(e)||"function"==typeof e},Q=function(e){return!(!e||1!==e.nodeType)},Y=function(e){return e instanceof jQuery},oe=function(e){return ne(e)&&B(e.then)},H=function(e){return oe(e)&&B(e.resolve)},N=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},V=function(e){return up.browser.canFormData()&&e instanceof FormData},nt=function(e){return Array.prototype.slice.call(e)},g=function(e){return N(e)?e.slice():G(e)?C({},e):void 0},ot=function(e){return Y(e)?e.get(0):e},me=function(){var t;return t=1<=arguments.length?e.call(arguments,0):[],C.apply(null,[{}].concat(e.call(t)))},Ce=function(e,t){var n,r,o,i;if(o=e?g(e):{},t)for(r in t)n=t[r],i=o[r],X(i)?ne(n)&&ne(i)&&(o[r]=Ce(i,n)):o[r]=n;return o},Oe=function(){var t;return t=1<=arguments.length?e.call(arguments,0):[],A(t,X)},A=function(e,t){var n,r,o,i;for(i=void 0,r=0,o=e.length;r<o;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;r<o;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;r<o;r++)if(n=e[r],!t(n)){i=!1;break}return i},h=function(e){return Je(e,X)},it=function(e){var t;return t={},Je(e,function(e){return!t.hasOwnProperty(e)&&(t[e]=!0)})},Je=function(e,t){var n;return n=[],x(e,function(e){if(t(e))return n.push(e)}),n},Me=function(e,t){return Je(e,function(e){return!t(e)})},K=function(e,t){return Je(e,function(e){return v(t,e)})},Le=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;e<o;e++)n=r[e],i.push(t.attr(n));return i}(),A(o,re)},Ge=function(e,t){return e>0?setTimeout(t,e):void t()},ye=function(e){return setTimeout(e,0)},pe=function(e){return e[e.length-1]},d=function(){var e;return e=document.documentElement,{width:e.clientWidth,height:e.clientHeight}},Qe=he(function(){var e,t,r;return e=n("<div>"),e.attr("up-viewport",""),e.css({position:"absolute",top:"0",left:"0",width:"100px",height:"100px",overflowY:"scroll"}),e.appendTo(document.body),t=e.get(0),r=t.offsetWidth-t.clientWidth,e.remove(),r}),$=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},xe=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}},Ze=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()):xe(i)},I=function(e){var t,n;return n=e.css(["transform","-webkit-transform"]),W(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=ot(e),e.offsetHeight},k=function(e,t,r){var o,u,a,s,l,p,c,f;return o=n(e),r=Ce(r,{duration:300,delay:0,easing:"ease"}),0===r.duration?(o.css(t),qe()):(u=n.Deferred(),c=Object.keys(t),l={"transition-property":c.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"),p=function(){return o.removeClass("up-animating"),o.off("transitionend",s)},s=function(e){var t;if(t=e.originalEvent.propertyName,v(c,t))return u.resolve(),p()},o.on("transitionend",s),u.then(p),f=I(o),o.css(l),o.css(t),o.data(i,u),u.then(function(){var e;if(o.removeData(i),f(),o.css({transition:"none"}),e=!("none"===a["transition-property"]||"all"===a["transition-property"]&&"0"===a["transition-duration"][0]))return _(o),o.css(a)}),u)},i="up-animation-deferred",U=function(e){return n(e).each(function(){var e;if(e=Fe(this,i))return e.resolve()})},de=function(e,t){var r,o,i,u,a;return t=Ce(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;r<o;r++)n=i[r],n.specified?u.push(t.attr(n.name,n.value)):u.push(void 0);return u},R=function(e,t){return e.find(t).addBack(t)},D=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}},ce=function(e){return e.getResponseHeader("X-Up-Location")},tt=function(e){return e.getResponseHeader("X-Up-Title")},ve=function(e){return e.getResponseHeader("X-Up-Method")},Ee=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;n<r;n++)u=i[n],o.hasOwnProperty(u)&&(t[u]=o[u]);return t},O=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;n<r;n++)u=i[n],delete t[u];return t},se=function(e){return!(e.metaKey||e.shiftKey||e.ctrlKey)},le=function(e){var t;return t=ae(e.button)||0===e.button,t&&se(e)},qe=function(){var e;return e=n.Deferred(),e.resolve(),e},ze=function(){return qe().promise()},ut=function(){return n.Deferred()},at=function(){return ut().promise()},Ae=function(){return n()},He=function(){var t,r;return t=1<=arguments.length?e.call(arguments,0):[],r=n.when.apply(n,[qe()].concat(e.call(t))),r.resolve=he(function(){return x(t,function(e){return e.resolve()})}),r},Xe=function(e,t){var n,r,o;r=[];for(n in t)o=t[n],Z(e.attr(n))?r.push(e.attr(n,o)):r.push(void 0);return r},je=function(e,t){var n;if(n=e.indexOf(t),n>=0)return e.splice(n,1),t},ge=function(e){var t,r,o,i,u,a,s;for(u={},s=[],r=[],o=0,i=e.length;o<i;o++)a=e[o],ue(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=Ae(),a=u.parsed,o=0,i=a.length;o<i;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||Ae()},u},T=function(){var t,n;return n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],B(n)?n.apply(null,t):n},c=function(t){var n,r,o,i,u,a,s,l,p,c,f,d,h,m;return null==t&&(t={}),h=void 0,c=function(){return T(t.size)},o=function(){return T(t.expiry)},f=function(e){return t.key?t.key(e):e.toString()},u=function(){return 0!==c()&&0!==o()},r=function(){return h={}},r(),l=function(){var n;if(n=1<=arguments.length?e.call(arguments,0):[],t.logPrefix)return n[0]="["+t.logPrefix+"] "+n[0],up.puts.apply(up,n)},s=function(){return Object.keys(h)},p=function(){var e,t,n,r;if(r=g(s()),e=c(),e&&r.length>=e&&(t=null,n=null,x(r,function(e){var r,o;if(r=h[e],o=r.timestamp,!n||n>o)return t=e,n=o}),t))return delete h[t]},n=function(e,t){var n;if(n=i(e,{silent:!0}),q(n))return d(t,n)},m=function(){return(new Date).valueOf()},d=function(e,t){var n;if(u())return p(),n=f(e),h[n]={timestamp:m(),value:t}},je=function(e){var t;return t=f(e),delete h[t]},a=function(e){var t,n;return t=o(),!t||(n=m()-e.timestamp,n<t)},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 je(e)):void(t.silent||l("Cache miss for '%s'",e))},{alias:n,get:i,set:d,remove:je,clear:r,keys:s}},m=function(e){var t;return t=Te(e),Object.preventExtensions(t),t},Te=function(e){var t;return null==e&&(e={}),t={},t.reset=function(){var n;return n=e,B(n)&&(n=n()),C(t,n)},t.reset(),t},st=function(e){var t,n;return e=ot(e),t=e.parentNode,n=nt(e.childNodes),x(n,function(n){return t.insertBefore(n,e)}),t.removeChild(e)},$e=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},J=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}},L=function(e,t){var r,o,i,u;return r=n(e),o=$e(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:""})},Ke=function(e){var t,n,r,o,i,u,a;if(V(e))return up.fail("Cannot convert FormData into an array");for(u=Ne(e),t=[],a=u.split("&"),n=0,r=a.length;n<r;n++)i=a[n],re(i)&&(o=i.split("="),t.push({name:decodeURIComponent(o[0]),value:decodeURIComponent(o[1])}));return t},Ne=function(e){var t;return V(e)?up.fail("Cannot convert FormData into a query string"):re(e)?(t=n.param(e),t=t.replace(/\+/g,"%20")):""},We=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()},p=function(e,t,n){var r;return V(e)?e.append(t,n):N(e)?e.push({name:t,value:n}):ne(e)?e[t]=n:(ue(e)||Z(e))&&(r=Ne([{name:t,value:n}]),e=re(e)?[e,r].join("&"):r),e},F=function(){var t,n,r,o,i,u;throw t=1<=arguments.length?e.call(arguments,0):[],N(t[0])?(r=t[0],u=t[1]||{}):(r=t,u={}),(o=up.log).error.apply(o,r),lt().then(function(){return up.toast.open(r,u)}),n=(i=up.browser).sprintf.apply(i,r),new Error(n)},a={"&":"&","<":"<",">":">",'"':"""},E=function(e){return e.replace(/[&<>"]/g,function(e){return a[e]})},Re=function(e,t){var n;return n=e[t],delete e[t],n},Fe=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=pe(e),G(t)&&!Y(t)?e.pop():{}},De=function(e){var t;return t=n(e).css("opacity"),X(t)?parseFloat(t):void 0},lt=he(function(){var e;return n.isReady?ze():(e=n.Deferred(),n(function(){return e.resolve()}),e.promise())}),j=function(e){return e},z=function(e){return e=ot(e),!jQuery.contains(document.documentElement,e)},Ie=function(t){var r,o;return r=n.Deferred(),o=function(){var n,o;return n=1<=arguments.length?e.call(arguments,0):[],o=t.apply(null,n),oe(o)?o.then(function(){return r.resolve(o)}):r.resolve(o),o},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=fe(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;if(!this.currentTask&&(this.currentTask=this.queue.shift()))return e=this.currentTask(),e.always(function(e){return function(){return e.currentTask=void 0,e.poke()}}(this))},r.prototype.asap=function(){var t;return t=1<=arguments.length?e.call(arguments,0):[],this.queue=fe(t,Ie),this.poke()},r}(),Ye=function(e){var t;return t=n(e),t.is("[type=checkbox], [type=radio]")&&!t.is(":checked")?void 0:t.val()},Be=function(){var t;return t=1<=arguments.length?e.call(arguments,0):[],function(){return fe(t,function(e){return e()})}},_e=function(e){var t,r;return t=n.Deferred(),r=Ge(e,function(){return t.resolve()}),t.cancel=function(){return clearTimeout(r)},t},M=function(e){var t,n,r,o;return t=de(e),r=d(),n=t.left+.5*t.width,o=.5*r.width,n<o?"left":"right"},S=function(e,t){var r;return r=n("<div></div>"),r.insertAfter(e),e.detach(),r.replaceWith(t),e},{isDetached:z,requestDataAsArray:Ke,requestDataAsQuery:Ne,appendRequestData:p,requestDataFromForm:We,offsetParent:$e,fixedToAbsolute:L,isFixed:J,presentAttr:Le,createElement:b,parseUrl:Pe,normalizeUrl:Se,normalizeMethod:ke,createElementFromHtml:w,$createElementFromSelector:r,$createPlaceholder:o,selectorForElement:Ve,extend:C,copy:g,merge:me,options:Ce,option:Oe,fail:F,each:x,map:fe,times:et,any:l,all:s,detect:A,select:Je,reject:Me,intersect:K,compact:h,uniq:it,last:pe,isNull:ee,isDefined:q,isUndefined:ae,isGiven:X,isMissing:Z,isPresent:re,isBlank:W,presence:Ue,isObject:ne,isFunction:B,isString:ue,isNumber:te,isElement:Q,isJQuery:Y,isPromise:oe,isDeferred:H,isHash:G,isArray:N,isFormData:V,isUnmodifiedKeyEvent:se,isUnmodifiedMouseEvent:le,nullJQuery:Ae,unJQuery:ot,setTimer:Ge,nextFrame:ye,measure:de,temporaryCss:Ze,cssAnimate:k,finishCssAnimate:U,forceCompositing:I,forceRepaint:_,escapePressed:D,copyAttributes:y,findWithSelf:R,contains:v,toArray:nt,castedAttr:f,locationFromXhr:ce,titleFromXhr:tt,methodFromXhr:ve,clientSize:d,only:Ee,except:O,trim:rt,unresolvableDeferred:ut,unresolvablePromise:at,resolvedPromise:ze,resolvedDeferred:qe,resolvableWhen:He,setMissingAttrs:Xe,remove:je,memoize:he,scrollbarWidth:Qe,documentHasVerticalScrollbar:$,config:m,openConfig:Te,cache:c,unwrapElement:st,multiSelector:ge,error:F,pluckData:Fe,pluckKey:Re,extractOptions:P,isDetached:z,noop:we,opacity:De,whenReady:lt,identity:j,escapeHtml:E,DivertibleChain:u,submittedValue:Ye,sequence:Be,promiseTimer:_e,previewable:Ie,evalOption:T,horizontalScreenHalf:M,detachWith:S}}($),up.fail=up.util.fail}.call(this),function(){var slice=[].slice;up.browser=function($){var CONSOLE_PLACEHOLDERS,canCssTransition,canFormData,canInputEvent,canLogSubstitution,canPushState,initialRequestMethod,installPolyfills,isIE8OrWorse,isIE9OrWorse,isRecentJQuery,isSupported,loadPage,popCookie,puts,sessionStorage,setLocationHref,sprintf,sprintfWithFormattedArgs,stringifyArg,submitForm,u,url,whenConfirmed;return u=up.util,loadPage=function(e,t){var n,r,o,i,a;return null==t&&(t={}),i=u.option(t.method,"get").toLowerCase(),"get"===i?(a=u.requestDataAsQuery(t.data),a&&(e=e+"?"+a),setLocationHref(e)):(n=$("<form method='post' action='"+e+"' class='up-page-loader'></form>"),r=function(e){var t;return t=$('<input type="hidden">'),t.attr(e),t.appendTo(n)},r({name:up.proxy.config.wrapMethodParam,value:i}),(o=up.rails.csrfField())&&r(o),u.each(u.requestDataAsArray(t.data),r),n.hide().appendTo("body"),submitForm(n))},submitForm=function(e){return e.submit()},setLocationHref=function(e){return location.href=e},puts=function(){var e,t,n;return n=arguments[0],e=2<=arguments.length?slice.call(arguments,1):[],canLogSubstitution()?console[n].apply(console,e):(t=sprintf.apply(null,e),console[n](t))},CONSOLE_PLACEHOLDERS=/\%[odisf]/g,stringifyArg=function(e){var t,n,r,o,i,a,s,l,p;if(a=200,r="",u.isString(e))l=e.replace(/[\n\r\t ]+/g," "),l=l.replace(/^[\n\r\t ]+/,""),l=l.replace(/[\n\r\t ]$/,""),l='"'+l+'"',r='"';else if(u.isUndefined(e))l="undefined";else if(u.isNumber(e)||u.isFunction(e))l=e.toString();else if(u.isArray(e))l="["+u.map(e,stringifyArg).join(", ")+"]",r="]";else if(u.isJQuery(e))l="$("+u.map(e,stringifyArg).join(", ")+")",r=")";else if(u.isElement(e)){for(t=$(e),l="<"+e.tagName.toLowerCase(),s=["id","name","class"],o=0,i=s.length;o<i;o++)n=s[o],(p=t.attr(n))&&(l+=" "+n+'="'+p+'"');l+=">",r=">"}else l=JSON.stringify(e);return l.length>a&&(l=l.substr(0,a)+" \u2026",l+=r),l},sprintf=function(){var e,t;return t=arguments[0],e=2<=arguments.length?slice.call(arguments,1):[],sprintfWithFormattedArgs.apply(null,[u.identity,t].concat(slice.call(e)))},sprintfWithFormattedArgs=function(){var e,t,n,r;return t=arguments[0],r=arguments[1],e=3<=arguments.length?slice.call(arguments,2):[],u.isBlank(r)?"":(n=0,r.replace(CONSOLE_PLACEHOLDERS,function(){var r;return r=e[n],r=t(stringifyArg(r)),n+=1,r}))},url=function(){return location.href},isIE8OrWorse=u.memoize(function(){return u.isUndefined(document.addEventListener)}),isIE9OrWorse=u.memoize(function(){return isIE8OrWorse()||navigator.appVersion.indexOf("MSIE 9.")!==-1}),canPushState=u.memoize(function(){return u.isDefined(history.pushState)&&"get"===initialRequestMethod()}),canCssTransition=u.memoize(function(){return"transition"in document.documentElement.style}),canInputEvent=u.memoize(function(){return"oninput"in document.createElement("input")}),canFormData=u.memoize(function(){return!!window.FormData}),canLogSubstitution=u.memoize(function(){return!isIE9OrWorse()}),isRecentJQuery=u.memoize(function(){var e,t,n,r;return r=$.fn.jquery,n=r.split("."),e=parseInt(n[0]),t=parseInt(n[1]),e>=2||1===e&&t>=9}),popCookie=function(e){var t,n;return n=null!=(t=document.cookie.match(new RegExp(e+"=(\\w+)")))?t[1]:void 0,u.isPresent(n)&&(document.cookie=e+"=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/"),n},whenConfirmed=function(e){return e.preload||u.isBlank(e.confirm)||window.confirm(e.confirm)?u.resolvedPromise():u.unresolvablePromise()},initialRequestMethod=u.memoize(function(){return(popCookie("_up_request_method")||"get").toLowerCase()}),isSupported=function(){return!isIE8OrWorse()&&isRecentJQuery()},installPolyfills=function(){var e,t,n,r;for(null==window.console&&(window.console={}),r=["debug","info","warn","error","group","groupCollapsed","groupEnd"],e=0,t=r.length;e<t;e++)n=r[e],null==console[n]&&(console[n]=function(){var e;return e=1<=arguments.length?slice.call(arguments,0):[],puts.apply(null,["log"].concat(slice.call(e)))});return null!=console.log?console.log:console.log=u.noop},sessionStorage=u.memoize(function(){return window.sessionStorage||{getItem:u.noop,setItem:u.noop,removeItem:u.noop}}),{knife:eval("undefined"!=typeof Knife&&null!==Knife?Knife.point:void 0),url:url,loadPage:loadPage,whenConfirmed:whenConfirmed,canPushState:canPushState,canCssTransition:canCssTransition,canInputEvent:canInputEvent,canFormData:canFormData,canLogSubstitution:canLogSubstitution,isSupported:isSupported,installPolyfills:installPolyfills,puts:puts,sprintf:sprintf,sprintfWithFormattedArgs:sprintfWithFormattedArgs,sessionStorage:sessionStorage}}(jQuery)}.call(this),function(){var slice=[].slice;up.bus=function($){var boot,consumeAction,emit,emitReset,forgetUpDescription,haltEvent,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||up.fail("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,n!==!1&&(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)},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){if(u.escapePressed(t))return e(t)})},haltEvent=function(e){return e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault()},consumeAction=function(e){if(haltEvent(e),"up:action:consumed"!==e.type)return emit("up:action:consumed",{$element:$(e.target),message:!1})},snapshot=function(){var e,t,n,r;for(r=[],t=0,n=liveUpDescriptions.length;t<n;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;n<r;n++)e=t[n],o.push(unbind.apply(null,e));return o},emitReset=function(){return emit("up:framework:reset",{message:"Resetting framework"})},boot=function(){if(up.browser.isSupported())return 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"})})})},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,haltEvent:haltEvent,consumeAction:consumeAction,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,p,c,f,d,h,m;return h=up.util,n=up.browser,t="up.log.enabled",r=h.config({prefix:"[UP] ",enabled:"true"===n.sessionStorage().getItem(t),collapse:!1}),f=function(){return r.reset()},l=function(e){return""+r.prefix+e},o=function(){var t,o;if(o=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],r.enabled&&o)return n.puts.apply(n,["debug",l(o)].concat(e.call(t)))},c=function(){var t,o;if(o=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],r.enabled&&o)return n.puts.apply(n,["log",l(o)].concat(e.call(t)))},m=function(){var t,o;if(o=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],r.enabled&&o)return n.puts.apply(n,["warn",l(o)].concat(e.call(t)))},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;if(r=arguments[0],t=2<=arguments.length?e.call(arguments,1):[],r)return n.puts.apply(n,["error",l(r)].concat(e.call(t)))},p=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",p),up.on("up:framework:reset",f),d=function(e){return n.sessionStorage().setItem(t,e.toString()),r.enabled=e},u=function(){return d(!0)},i=function(){return d(!1)},{puts:c,debug:o,error:a,warn:m,group:s,config:r,enable:u,disable:i}}(jQuery),up.puts=up.log.puts}.call(this),function(){var e=[].slice;up.toast=function(t){var n,r,o,i,u,a,s,l,p,c;return c=up.util,o=up.browser,n=function(e){return"<span class='up-toast-variable'>"+c.escapeHtml(e)+"</span>"},p=c.config({$toast:null}),l=function(){return i(),p.reset()},a=function(t){return c.isArray(t)?(t[0]=c.escapeHtml(t[0]),t=o.sprintfWithFormattedArgs.apply(o,[n].concat(e.call(t)))):t=c.escapeHtml(t),t},u=function(){return!!p.$toast},r=function(e,n,r){var o;return o=t('<span class="up-toast-action"></span>').text(n),o.on("click",r),o.appendTo(e)},s=function(e,n){var o,u,s,l;return null==n&&(n={}),i(),s=t('<div class="up-toast"></div>').prependTo("body"),u=t('<div class="up-toast-message"></div>').appendTo(s),o=t('<div class="up-toast-actions"></div>').appendTo(s),e=a(e),u.html(e),(l=n.action||n.inspect)&&r(o,l.label,l.callback),r(o,"Close",i),p.$toast=s},i=function(){if(u())return p.$toast.remove(),p.$toast=null},up.on("up:framework:reset",l),{open:s,close:i,reset:l,isOpen:u}}(jQuery)}.call(this),function(){var e=[].slice;up.syntax=function(t){var n,r,o,i,u,a,s,l,p,c,f,d,h,m,v,g,y;return y=up.util,n="up-destructible",r="up-destructors",p=[],m=[],l=function(){var t;return t=1<=arguments.length?e.call(arguments,0):[],d.apply(null,[p].concat(e.call(t)))},h=function(){var t;return t=1<=arguments.length?e.call(arguments,0):[],d.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=y.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}},d=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,u,a,s,l,p;for(up.puts(e.isDefault?void 0:"Compiling '%s' on %o",e.selector,n),e.keep&&(p=y.isString(e.keep)?e.keep:"",t.attr("up-keep",p)),l=e.callback.apply(n,[t,c(t)]),a=f(l),s=[],i=0,u=a.length;i<u;i++)r=a[i],s.push(o(t,r));return s},f=function(e){return y.isFunction(e)?[e]:y.isArray(e)&&y.all(e,y.isFunction)?e:[]},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=y.options(n),r=t(n.skip),up.log.group("Compiling fragment %o",e.get(0),function(){var n,o,u,a,s,c;for(s=[m,p],c=[],o=0,u=s.length;o<u;o++)a=s[o],c.push(function(){var o,u,s;for(s=[],o=0,u=a.length;o<u;o++)l=a[o],n=y.findWithSelf(e,l.selector),n=n.filter(function(){var e;return e=t(this),y.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 c})},a=function(e){return y.findWithSelf(e,"."+n).each(function(){var e,o,i,u,a;if(e=t(this),i=e.data(r)){for(u=0,a=i.length;u<a;u++)(o=i[u])();return e.removeData(r),e.removeClass(n)}})},c=function(e){var n,r;return n=t(e),r=n.attr("up-data"),y.isString(r)&&""!==y.trim(r)?JSON.parse(r):{}},g=function(){var e;return e=function(e){return e.isDefault=!0},y.each(p,e),y.each(m,e)},v=function(){var e;return e=function(e){return e.isDefault},p=y.select(p,e),m=y.select(m,e)},up.on("up:framework:booted",g),up.on("up:framework:reset",v),{compiler:l,macro:h,compile:s,clean:a,data:c}}(jQuery),up.compiler=up.syntax.compiler,up.macro=up.syntax.macro}.call(this),function(){up.history=function(e){var t,n,r,o,i,u,a,s,l,p,c,f,d,h,m,v;return v=up.util,n=v.config({popTargets:["body"],restoreScroll:!0}),p=void 0,u=void 0,h=function(){return n.reset(),p=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&&(p=u,u=void 0),u=e},d=function(e){return i("replaceState",e)},c=function(e,t){if(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}))return 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())):up.fail("This browser doesn't support history."+e)},t=function(){return{fromUp:!0}},m=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:p}),t=e.originalEvent.state,m(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){if(v.isPresent(p))return v.setMissingAttrs(e,{"up-href":p,"up-restore-scroll":""}),e.removeAttr("up-back"),up.link.makeFollowable(e)}),up.on("up:framework:reset",h),{config:n,defaults:function(){return up.fail("up.history.defaults(...) no longer exists. Set values on he up.history.config property instead.")},push:c,replace:d,url:r,previousUrl:function(){return p},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;
|
2
|
+
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;if(e=$(this).data(SCROLL_PROMISE_KEY))return e.resolve()})},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)||up.fail("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;e<t;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;e<t;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,p,c,f,d,h,m,v;return n=$(e),up.puts("Revealing fragment %o",e.get(0)),t=u.options(t),r=t.viewport?$(t.viewport):viewportOf(n),h=u.option(t.snap,config.snap),v=r.is(document),m=v?u.clientSize().height:r.outerHeight(),c=r.scrollTop(),s=c,p=void 0,l=void 0,v?(l=measureObstruction(),p=0):(l={top:0,bottom:0},p=c),f=function(){return s+l.top},d=function(){return s+m-l.bottom-1},o=u.measure(n,{relative:r}),i=o.top+p,a=i+Math.min(o.height,config.substance)-1,a>d()&&(s+=a-d()),(i<f()||t.top)&&(s=i-l.top),s<h&&o.top<.5*m&&(s=0),s!==c?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&&up.fail("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;t<r;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},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,a;return n=$(e),t.restoreScroll?restoreScroll({around:n}):t.reveal?(a={},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,a.top=!0))),reveal(n,a)):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 up.fail("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)):up.fail("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},n.inspectResponse=function(){return up.browser.loadPage(t,u.only(n,"method","data"))},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,p;return i.method=u.normalizeMethod(u.option(u.methodFromXhr(o),i.method)),a="GET"===i.method,(p=u.locationFromXhr(o))?(n=p,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;e<t;e++)u=r[e],up.log.group("Updating %s",u.selector,function(){var e,t,r;if(t=findOldFragment(u.selector,n),e=o.first(u.selector),t&&e)return filterScripts(e,n),r=swapElements(t,e,u.pseudoClass,u.transition,n),a.push(r),n.reveal=!1});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;if(t.requireMatch)return 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)"),up.fail(r,e)},filterScripts=function(e,t){var n,r,o,i,a,s,l,p,c,f;for(p=u.option(t.runInlineScripts,config.runInlineScripts),c=u.option(t.runLinkedScripts,config.runLinkedScripts),r=u.findWithSelf(e,"script"),l=[],a=0,s=r.length;a<s;a++)f=r[a],n=$(f),i=u.isPresent(n.attr("src")),o=!i,i&&c||o&&p?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},first:function(r){var o,i;return(o=$.find(r,n)[0])?$(o):t.requireMatch?(i={label:"Open response",callback:t.inspectResponse},up.fail(["Could not find selector %s in response %o",r,e],{action:i})):void 0}}},updateHistory=function(e){if(e=u.options(e,{historyMethod:"push"}),e.history&&up.history[e.historyMethod](e.history),e.title)return document.title=e.title},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,p,c;if(a=[],n.keep)for(c=e.find("[up-keep]"),i=0,l=c.length;i<l;i++)s=c[i],r=$(s),(p=findKeepPlan(r,t,u.merge(n,{descendantsOnly:!0})))&&(o=r.clone(),up.util.detachWith(r,o),p.$newElement.replaceWith(r),a.push(p));return a},findKeepPlan=function(e,t,n){var r,o,i,a,s;if(n.keep&&(r=e,(a=u.castedAttr(r,"up-keep"))&&(u.isString(a)||(a="&"),a=resolveSelector(a,r),o=n.descendantsOnly?t.find(a):u.findWithSelf(t,a),o=o.first(),o.length&&o.is("[up-keep]")&&(s={$element:r,$newElement:o,newData:up.syntax.data(o)},i=u.merge(s,{message:["Keeping element %o",r.get(0)]}),up.bus.nobodyPrevents("up:fragment:keep",i)))))return s},parseImplantSteps=function(e,t){var n,r,o,i,a,s,l,p,c,f,d,h;for(d=t.transition||t.animation||"none",n=/\ *,\ */,r=e.split(n),h=u.isString(h)?d.split(n):[d],l=[],o=i=0,a=r.length;i<a;o=++i)p=r[o],c=p.match(/^(.+?)(?:\:(before|after))?$/),c||up.fail('Could not parse selector atom "%s"',p),e=c[1],"html"===e&&(e="body"),s=c[2],f=h[o]||u.last(h),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;r<i;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;if(n="[autofocus]:last",t=u.findWithSelf(e,n),t.length&&t.get(0)!==document.activeElement)return t.focus()},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;r<a&&(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;u<a;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,p,c,f,d,h,m,v,g,y,b,w,k,S,A,$,x,E,D,T,O;return T=up.util,a={},p={},E={},c={},l=T.config({duration:300,delay:0,easing:"ease",enabled:!0}),k=function(){return h(),a=T.copy(p),E=T.copy(c),l.reset()},v=function(){return l.enabled&&up.browser.canCssTransition()},o=function(e,n,r){var u;return u=t(e),h(u),r=i(r),"none"===n||n===!1||T.isMissing(n)?b():T.isFunction(n)?s(n(u,r),n):T.isString(n)?o(u,d(n),r):T.isHash(n)?v()?T.cssAnimate(u,n,r):(u.css(n),T.resolvedDeferred()):up.fail("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=T.isJQuery(n[0])?n.shift():T.nullJQuery(),o=T.isObject(n[0])?n.shift():{},r={},r.easing=T.option(i.easing,T.presentAttr(t,"up-easing"),o.easing,l.easing),r.duration=Number(T.option(i.duration,T.presentAttr(t,"up-duration"),o.duration,l.duration)),r.delay=Number(T.option(i.delay,T.presentAttr(t,"up-delay"),o.delay,l.delay)),r},d=function(e){return a[e]||up.fail("Unknown animation %o",e)},r="up-ghosting-deferred",n="up-ghosting",O=function(e,t,o,i){var u,a,s,l,p,c,f,d;return o.copy===!1||e.is(".up-ghost")||t.is(".up-ghost")?i(e,t):(c=void 0,l=void 0,f=void 0,p=void 0,a=up.layout.viewportOf(e),u=e.add(t),T.temporaryCss(t,{display:"none"},function(){return c=w(e,a),f=a.scrollTop()}),T.temporaryCss(e,{display:"none"},function(){return up.layout.revealOrRestoreScroll(t,o),l=w(t,a),p=a.scrollTop()}),c.moveTop(p-f),e.hide(),d=T.temporaryCss(t,{opacity:"0"}),s=i(c.$ghost,l.$ghost),u.data(r,s),u.addClass(n),s.then(function(){return u.removeData(r),u.removeClass(n),d(),c.$bounds.remove(),l.$bounds.remove()}),s)},h=function(e){var r,o,i;return null==e&&(e=".up-animating"),o=t(e),r=T.findWithSelf(o,".up-animating"),T.finishCssAnimate(r),i=T.findWithSelf(o,"."+n),m(i)},m=function(e){return e.each(function(){var e,n;if(e=t(this),n=T.pluckData(e,r))return n.resolve()})},s=function(e,t){return T.isDeferred(e)?e:up.fail("Did not return a promise with .then and .resolve methods: %o",t)},y=function(e,n,r,u){var l,p;return"none"===r&&(r=!1),u=T.options(u),p=t(e),l=t(n),f(p,r),f(l,r),up.log.group(r?"Morphing %o to %o (using %s, %o)":void 0,p.get(0),l.get(0),r,u,function(){var e,t,n,c;return t=T.only(u,"reveal","restoreScroll","source"),t=T.extend(t,i(u)),v()?(h(p),h(l),r?(e=a[r])?(A(p,l,t),o(l,e,t)):(c=T.presence(r,T.isFunction)||E[r])?O(p,l,t,function(e,n){var o;return o=c(e,n,t),s(o,r)}):T.isString(r)&&r.indexOf("/")>=0?(n=r.split("/"),c=function(e,t,r){return S(o(e,n[0],r),o(t,n[1],r))},y(p,l,c,t)):up.fail("Unknown transition %o",r):A(p,l,t)):A(p,l,t)})},f=function(e,t){var n;if(t&&0===e.parents("body").length)return n=e.get(0),up.fail("Can't morph a <%s> element (%o)",n.tagName,n)},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,p,c;for(u=T.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),c=u.top,p=function(e){if(0!==e)return c+=e,r.css({top:c})},i.appendTo(r),r.insertBefore(e),p(e.offset().top-i.offset().top),o=up.layout.fixedChildren(i),s=0,l=o.length;s<l;s++)a=o[s],T.fixedToAbsolute(a,n);return{$ghost:i,$bounds:r,moveTop:p}},x=function(e,t){return E[e]=t},u=function(e,t){return a[e]=t},$=function(){return p=T.copy(a),c=T.copy(E)},S=T.resolvableWhen,b=T.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)}),D=function(e,t){return{transform:"translate("+e+"px, "+t+"px)"}},u("move-to-top",function(e,t){var n,r;return n=T.measure(e),r=n.top+n.height,e.css(D(0,0)),o(e,D(0,-r),t)}),u("move-from-top",function(e,t){var n,r;return n=T.measure(e),r=n.top+n.height,e.css(D(0,-r)),o(e,D(0,0),t)}),u("move-to-bottom",function(e,t){var n,r;return n=T.measure(e),r=T.clientSize().height-n.top,e.css(D(0,0)),o(e,D(0,r),t)}),u("move-from-bottom",function(e,t){var n,r;return n=T.measure(e),r=T.clientSize().height-n.top,e.css(D(0,r)),o(e,D(0,0),t)}),u("move-to-left",function(e,t){var n,r;return n=T.measure(e),r=n.left+n.width,e.css(D(0,0)),o(e,D(-r,0),t)}),u("move-from-left",function(e,t){var n,r;return n=T.measure(e),r=n.left+n.width,e.css(D(-r,0)),o(e,D(0,0),t)}),u("move-to-right",function(e,t){var n,r;return n=T.measure(e),r=T.clientSize().width-n.left,e.css(D(0,0)),o(e,D(r,0),t)}),u("move-from-right",function(e,t){var n,r;return n=T.measure(e),r=T.clientSize().width-n.left,e.css(D(r,0)),o(e,D(0,0),t)}),u("roll-down",function(e,t){var n,r,i;return r=e.height(),i=T.temporaryCss(e,{height:"0px",overflow:"hidden"}),n=o(e,{height:r+"px"},t),n.then(i),n}),x("none",b),x("move-left",function(e,t,n){return S(o(e,"move-to-left",n),o(t,"move-from-right",n))}),x("move-right",function(e,t,n){return S(o(e,"move-to-right",n),o(t,"move-from-left",n))}),x("move-up",function(e,t,n){return S(o(e,"move-to-top",n),o(t,"move-from-bottom",n))}),x("move-down",function(e,t,n){return S(o(e,"move-to-bottom",n),o(t,"move-from-top",n))}),x("cross-fade",function(e,t,n){return S(o(e,"fade-out",n),o(t,"fade-in",n))}),up.on("up:framework:booted",$),up.on("up:framework:reset",k),{morph:y,animate:o,animateOptions:i,finish:h,transition:x,animation:u,config:l,isEnabled:v,defaults:function(){return up.fail("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,p,c,f,d,h,m,v,g,y,b,w,k,S,A,$,x,E,D,T,O,C,P,F,R,U,L;return L=up.util,n=void 0,x=void 0,F=void 0,S=void 0,R=void 0,D=[],c=L.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,L.requestDataAsQuery(e.data),e.target].join("|")},i=L.cache({size:function(){return c.cacheSize},expiry:function(){return c.cacheExpiry},key:u}),f=function(e){var t,n,r,o,u,a,s;if(e=k(e),h(e))for(n=[e],"html"!==e.target&&(a=L.merge(e,{target:"html"}),n.push(a),"body"!==e.target&&(u=L.merge(e,{target:"body"}),n.push(u))),r=0,o=n.length;r<o;r++)if(t=n[r],s=i.get(t))return s},a=function(){return clearTimeout(x),x=null},s=function(){return clearTimeout(F),F=null},O=function(){return n=null,a(),s(),S=0,c.reset(),i.clear(),R=!1,D=[]},O(),k=function(e){return e._normalized||(e.method=L.normalizeMethod(e.method),e.url&&(e.url=L.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=L.extractOptions(t),L.isGiven(t[0])&&(o.url=t[0]),n=o.cache===!0,r=o.cache===!1,a=L.only(o,"url","method","data","target","headers","_normalized"),a=k(a),i=!0,m(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),P(a,u),u.fail(function(){return T(a)})):(p(),u=b(a)),i&&!o.preload&&(w(),u.always(y)),u},h=function(e){return!L.isFormData(e.data)},v=function(){return 0===S},d=function(){return S>0},w=function(){var e,t;if(t=v(),S+=1,t)return e=function(){if(d())return up.emit("up:proxy:slow",{message:"Proxy is busy"}),R=!0},F=L.setTimer(c.slowDelay,e)},y=function(){if(S-=1,v()&&R)return up.emit("up:proxy:recover",{message:"Proxy is idle"}),R=!1},b=function(e){return S<c.maxRequests?g(e):E(e)},E=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},D.push(r),n.promise()},g=function(e){var n;return up.emit("up:proxy:load",L.merge(e,{message:["Loading %s %s",e.method,e.url]})),e=L.copy(e),e.headers||(e.headers={}),e.headers["X-Up-Target"]=e.target,L.contains(c.wrapMethods,e.method)&&(e.data=L.appendRequestData(e.data,c.wrapMethodParam,e.method),e.method="POST"),L.isFormData(e.data)&&(e.contentType=!1,e.processData=!1),n=t.ajax(e),n.done(function(t,n,r){return C(e,r)}),n.fail(function(t){return C(e,t)}),n},C=function(e,t){var n;return up.emit("up:proxy:received",L.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=D.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,P=i.set,T=i.remove,p=i.clear,m=function(e){return k(e),L.contains(c.safeMethods,e.method)},l=function(e){var t,r;if(r=parseInt(L.presentAttr(e,"up-delay"))||c.preloadDelay,!e.is(n))return n=e,a(),t=function(){return $(e),n=null},U(t,r)},U=function(e,t){return x=setTimeout(e,t)},$=function(e,n){var r,o;return r=t(e),n=L.options(n),o=up.link.followMethod(r,n),m({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),L.resolvedPromise())},up.on("mouseover mousedown touchstart","[up-preload]",function(e,t){if(!up.link.childClicked(e,t))return l(t)}),up.on("up:framework:reset",O),{preload:$,ajax:r,get:f,alias:o,clear:p,remove:T,isIdle:v,isBusy:d,isCachable:h,config:c,defaults:function(){return up.fail("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.start(e,function(){return t(e)})},up.on("click","a"+e+", [up-href]"+e,function(e,t){return shouldProcessLinkEvent(e,t)?t.is("[up-instant]")?up.bus.haltEvent(e):(up.bus.consumeAction(e),n(t)):allowDefault(e)}),up.on("mousedown","a"+e+"[up-instant], [up-href]"+e+"[up-instant]",function(e,t){if(shouldProcessLinkEvent(e,t))return up.bus.consumeAction(e),n(t)})},isFollowable=function(e){var t;return t=$(e),u.any(followVariantSelectors,function(e){return t.is(e)})},makeFollowable=function(e){var t;if(t=$(e),!isFollowable(t))return 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,p,c;if(t=e.find("a, [up-href]"),(p=e.attr("up-expand"))&&(t=t.filter(p)),i=t.get(0)){for(c=/^up-/,s={},s["up-href"]=$(i).attr("href"),l=i.attributes,r=0,o=l.length;r<o;r++)n=l[r],a=n.name,a.match(c)&&(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,isFollowable:isFollowable,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,observeField,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.start(n),r&&o?(a=up.replace(s,l,t),a.always(function(){return up.navigation.stop(n)}),a):(n.get(0).submit(),u.unresolvablePromise()))},observe=function(){var $element,$fields,callback,callbackArg,delay,destructors,extraArgs,options,rawCallback,selectorOrElement;return selectorOrElement=arguments[0],extraArgs=2<=arguments.length?slice.call(arguments,1):[],options={},callbackArg=void 0,1===extraArgs.length?callbackArg=extraArgs[0]:extraArgs.length>1&&(options=u.options(extraArgs[0]),callbackArg=extraArgs[1]),$element=$(selectorOrElement),$fields=u.multiSelector(config.fields).findWithSelf($element),callback=null,rawCallback=u.option(callbackArg,u.presentAttr($fields,"up-observe")),callback=u.isString(rawCallback)?function(value,$field){return eval(rawCallback)}:rawCallback||up.fail("up.observe: No change callback given"),delay=u.option($fields.attr("up-delay"),options.delay,config.observeDelay),delay=parseInt(delay),destructors=u.map($fields,function(e){return observeField($(e),delay,callback)}),u.sequence.apply(u,destructors)},observeField=function(e,t,n){var r,o,i,a,s,l;return a=u.submittedValue(e),l=void 0,i=u.resolvedPromise(),s=function(t){var r;return a=t,r=n.apply(e.get(0),[t,e]),i=u.isPromise(r)?r:r},o=function(){var n,r;if(r=u.submittedValue(e),a!==r)return n=function(){return s(r)},null!=l&&l.cancel(),l=u.promiseTimer(t),$.when(l,i).then(n)},r="input change",up.browser.canInputEvent()||(r+=" keypress paste cut click propertychange"),e.on(r,o),function(){return e.off(r,o),null!=l?l.cancel():void 0}},autosubmit=function(e,t){return observe(e,t,function(e,t){var n;return n=t.closest("form"),up.navigation.start(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)&&up.fail("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)||up.fail("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 up.bus.consumeAction(e),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,autosubmit:autosubmit}}(jQuery),up.submit=up.form.submit,up.observe=up.form.observe,up.autosubmit=up.form.autosubmit,up.validate=up.form.validate}.call(this),
|
3
|
+
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:up.fail("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||up.fail("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),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)},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(){if(!state.sticky)return 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("click up:action:consumed",function(e){var t;if(t=$(e.target),!t.closest(".up-popup, [up-popup]").length)return 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-popup [up-close]",function(e){return closeAsap(),up.bus.consumeAction(e)}),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,flavors,followAsap,isOpen,markAsAnimating,openAsap,openNow,reset,shiftElements,state,templateHtml,u,unshiftElements,visitAsap;return u=up.util,config=u.config({maxWidth: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",closable:!0,sticky:!1,flavor:"default",position:null,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>'+e.closeLabel+"</div>\n </div>\n </div>\n</div>"}}),flavors=u.openConfig({"default":{}}),state=u.config(function(){return{phase:"closed",$anchor:null,$modal:null,sticky:null,closable:null,flavor:null,url:null,coveredUrl:null,coveredTitle:null,position:null,unshifters:[]}}),chain=new u.DivertibleChain,reset=function(){var e;return null!=(e=state.$modal)&&e.remove(),unshiftElements(),state.reset(),chain.reset(),config.reset(),flavors.reset()},templateHtml=function(){var e;return e=flavorDefault("template"),u.evalOption(e,{closeLabel:flavorDefault("closeLabel")})},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),u.isPresent(state.position)&&o.attr("up-position",state.position),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),state.closable||o.find(".up-modal-close").remove(),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;if(u.documentHasVerticalScrollbar())return 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)})},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"),config.flavor),e.position=u.option(e.position,t.attr("up-position"),flavorDefault("position",e.flavor)),e.position=u.evalOption(e.position,{$link:t}),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.animation=u.evalOption(e.animation,{position:e.position}),e.backdropAnimation=u.option(e.backdropAnimation,t.attr("up-backdrop-animation"),flavorDefault("backdropOpenAnimation",e.flavor)),e.backdropAnimation=u.evalOption(e.backdropAnimation,{position:e.position}),e.sticky=u.option(e.sticky,u.castedAttr(t,"up-sticky"),flavorDefault("sticky",e.flavor)),e.closable=u.option(e.closable,u.castedAttr(t,"up-closable"),flavorDefault("closable",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.closable=e.closable,state.position=e.position,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")),o=u.evalOption(o,{position:state.position}),n=u.option(e.backdropAnimation,flavorDefault("backdropCloseAnimation")),n=u.evalOption(n,{position:state.position}),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,state.closable=null,state.position=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(){if(!state.sticky)return discardHistory(),closeAsap()},contains=function(e){var t;return t=$(e),t.closest(".up-modal").length>0},flavor=function(e,t){return null==t&&(t={}),up.log.warn("The up.modal.flavor function is deprecated. Use the up.modal.flavors property instead."),u.extend(flavorOverrides(e),t)},flavorOverrides=function(e){return flavors[e]||(flavors[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",function(e){var t;if(state.closable)return t=$(e.target),t.closest(".up-modal-dialog").length||t.closest("[up-modal]").length?void 0:(up.bus.consumeAction(e),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(function(){if(state.closable)return closeAsap()}),up.on("click",".up-modal [up-close]",function(e){return closeAsap(),up.bus.consumeAction(e)}),up.macro("[up-drawer]",function(e){var t;return t=e.attr("up-drawer"),e.attr({"up-modal":t,"up-flavor":"drawer"})}),flavors.drawer={openAnimation:function(e){switch(e.position){case"left":return"move-from-left";case"right":return"move-from-right"}},closeAnimation:function(e){switch(e.position){case"left":return"move-to-left";case"right":return"move-to-right"}},position:function(e){return u.isPresent(e.$link)?u.horizontalScreenHalf(e.$link):"left"}},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,flavors:flavors,contains:contains,isOpen:isOpen,flavor:flavor}}(jQuery)}.call(this),function(){up.tooltip=function(e){var t,n,r,o,i,u,a,s,l,p,c,f;return f=up.util,a=f.config({position:"top",openAnimation:"fade-in",closeAnimation:"fade-out",openDuration:100,closeDuration:50,openEasing:null,closeEasing:null}),c=f.config({phase:"closed",$anchor:null,$tooltip:null,position:null}),o=new f.DivertibleChain,p=function(){var e;return null!=(e=c.$tooltip)&&e.remove(),c.reset(),o.reset(),a.reset()},t=function(){var e,t,n;switch(e={},n=f.measure(c.$tooltip),f.isFixed(c.$anchor)?(t=c.$anchor.get(0).getBoundingClientRect(),e.position="fixed"):t=f.measure(c.$anchor),c.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:up.fail("Unknown position option '%s'",c.position)}return c.$tooltip.attr("up-position",c.position),c.$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),c.$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,p,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")),p=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}),c.phase="opening",c.$anchor=o,s({text:d,html:l}),c.position=p,t(),up.animate(c.$tooltip,u,i).then(function(){return c.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),c.phase="closing",up.destroy(c.$tooltip,e).then(function(){return c.phase="closed",c.$tooltip=null,c.$anchor=null})):f.resolvedPromise()},l=function(){return"opening"===c.phase||"opened"===c.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 up:action:consumed",function(){return i()}),up.on("up:framework:reset",p),up.bus.onEscape(function(){return i()}),{config:a,attach:n,isOpen:l,close:i}}(jQuery)}.call(this),function(){up.navigation=function(e){var t,n,r,o,i,u,a,s,l,p,c,f,d;return f=up.util,r=f.config({currentClasses:["up-current"]}),s=function(){return r.reset()},o=function(){var e;return e=r.currentClasses,e=e.concat(["up-current"]),e=f.uniq(e),e.join(" ")},t="up-active",n="a, [up-href]",a=function(e){if(f.isPresent(e))return f.normalizeUrl(e)},l=function(e){var t,n,r,o,i,u,s,l,p,c;for(l=[],u=["href","up-href","up-alias"],n=0,o=u.length;n<o;n++)if(t=u[n],p=f.presentAttr(e,t))for(c="up-alias"===t?p.split(" "):[p],r=0,i=c.length;r<i;r++)s=c[r],"#"!==s&&(s=a(s),l.push(s));return l},d=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}},u=function(){var t,r;return t=d([a(up.browser.url()),a(up.modal.url()),a(up.modal.coveredUrl()),a(up.popup.url()),a(up.popup.coveredUrl())]),r=o(),f.each(e(n),function(n){var o,i;return o=e(n),i=l(o),t.matchesAny(i)?o.addClass(r):o.hasClass(r)&&0===o.closest(".up-destroying").length?o.removeClass(r):void 0})},i=function(t){var r;return r=e(t),r.is(n)&&(r=f.presence(r.parent(n))||r),r},p=function(e,n){var r,o;if(r=i(e),r.addClass(t),n)return o=n(),f.isPromise(o)?o.always(function(){return c(r)}):up.warn("Expected block to return a promise, but got %o",o),o},c=function(e){var n;return n=i(e),up.emit("up:navigated",{$element:n,message:!1}),n.removeClass(t)},up.on("up:fragment:inserted",function(){return u()}),up.on("up:fragment:destroyed",function(e,t){if(t.is(".up-modal, .up-popup"))return u()}),up.on("up:framework:reset",s),{config:r,defaults:function(){return up.fail("up.navigation.defaults(...) no longer exists. Set values on he up.navigation.config property instead.")},start:p,stop:c}}(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;if(n()&&o(e))return u={},u[i]=e.attr(t),r.setMissingAttrs(e,u),e.removeAttr(t)})}),t=function(){if(n())return{name:e.rails.csrfParam(),value:e.rails.csrfToken()}},{csrfField:t,isRails:n}}(jQuery)}.call(this),function(){up.boot()}.call(this);
|
@@ -261,7 +261,7 @@ up.browser = (($) ->
|
|
261
261
|
|
262
262
|
# Server-side companion libraries like unpoly-rails set this cookie so we
|
263
263
|
# have a way to detect the request method of the initial page load.
|
264
|
-
# There is no
|
264
|
+
# There is no JavaScript API for this.
|
265
265
|
initialRequestMethod = u.memoize ->
|
266
266
|
(popCookie('_up_request_method') || 'get').toLowerCase()
|
267
267
|
|
@@ -36,8 +36,8 @@ use the more convenient [`up.on`](/up.on):
|
|
36
36
|
This improves jQuery's [`on`](http://api.jquery.com/on/) in multiple ways:
|
37
37
|
|
38
38
|
- Event listeners on [unsupported browsers](/up.browser.isSupported) are silently discarded,
|
39
|
-
leaving you with an application without
|
40
|
-
a soup of randomly broken
|
39
|
+
leaving you with an application without JavaScript. This is typically preferable to
|
40
|
+
a soup of randomly broken JavaScript in ancient browsers.
|
41
41
|
- A jQuery object with the target element is automatically passed to the event handler
|
42
42
|
as a second argument. You no longer need to write `$(this)` in the handler function.
|
43
43
|
- You use an [`up-data`](/up-data) attribute to [attach structured data](/up.on#attaching-structured-data)
|
@@ -424,7 +424,7 @@ up.bus = (($) ->
|
|
424
424
|
###*
|
425
425
|
Boots the Unpoly framework.
|
426
426
|
|
427
|
-
**This is called automatically** by including the Unpoly
|
427
|
+
**This is called automatically** by including the Unpoly JavaScript files.
|
428
428
|
|
429
429
|
Unpoly will not boot if the current browser is [not supported](/up.browser.isSupported).
|
430
430
|
This leaves you with a classic server-side application on legacy browsers.
|
@@ -1,12 +1,12 @@
|
|
1
1
|
###*
|
2
|
-
|
3
|
-
|
2
|
+
Fragment update API
|
3
|
+
===================
|
4
4
|
|
5
5
|
This module contains Unpoly's core functions to [change](/up.replace) or
|
6
|
-
[destroy](/up.destroy) page fragments via
|
6
|
+
[destroy](/up.destroy) page fragments via JavaScript.
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
Other Unpoly modules (like [`up.link`](/up.link) or [`up.modal`](/up.modal))
|
9
|
+
build upon this module to offer higher level API functions.
|
10
10
|
|
11
11
|
@class up.flow
|
12
12
|
###
|
@@ -22,7 +22,7 @@ up.flow = (($) ->
|
|
22
22
|
Whether inline `<script>` tags inside inserted HTML fragments will be executed.
|
23
23
|
@param {Boolean} [options.runLinkedScripts=false]
|
24
24
|
Whether `<script src='...'>` tags inside inserted HTML fragments will fetch and execute
|
25
|
-
the linked
|
25
|
+
the linked JavaScript file.
|
26
26
|
@stable
|
27
27
|
###
|
28
28
|
config = u.config
|
@@ -332,7 +332,7 @@ up.flow = (($) ->
|
|
332
332
|
@return {Promise}
|
333
333
|
A promise that will be resolved then the selector was updated
|
334
334
|
and all animation has finished.
|
335
|
-
@
|
335
|
+
@stable
|
336
336
|
###
|
337
337
|
extract = (selectorOrElement, html, options) ->
|
338
338
|
up.log.group 'Extracting %s from %d bytes of HTML', selectorOrElement, html?.length, ->
|
@@ -449,6 +449,8 @@ up.flow = (($) ->
|
|
449
449
|
promise = promise.then -> u.unwrapElement($wrapper)
|
450
450
|
|
451
451
|
else if keepPlan = findKeepPlan($old, $new, options)
|
452
|
+
# Since we're keeping the element that was requested to be swapped,
|
453
|
+
# there is nothing left to do here.
|
452
454
|
emitFragmentKept(keepPlan)
|
453
455
|
promise = u.resolvedPromise()
|
454
456
|
|
@@ -499,7 +501,9 @@ up.flow = (($) ->
|
|
499
501
|
# $old and $new. Note that $keepable will still point to the same element
|
500
502
|
# after the replacement, which is now detached.
|
501
503
|
$keepableClone = $keepable.clone()
|
502
|
-
|
504
|
+
up.util.detachWith($keepable, $keepableClone)
|
505
|
+
|
506
|
+
# $keepable.replaceWith($keepableClone)
|
503
507
|
# Since we're going to swap the entire $old and $new containers afterwards,
|
504
508
|
# replace the matching element with $keepable so it will eventually return to the DOM.
|
505
509
|
plan.$newElement.replaceWith($keepable)
|
@@ -518,13 +522,13 @@ up.flow = (($) ->
|
|
518
522
|
$partner = u.findWithSelf($new, partnerSelector)
|
519
523
|
$partner = $partner.first()
|
520
524
|
if $partner.length && $partner.is('[up-keep]')
|
521
|
-
|
525
|
+
plan =
|
522
526
|
$element: $keepable # the element that should be kept
|
523
527
|
$newElement: $partner # the element that would have replaced it but now does not
|
524
528
|
newData: up.syntax.data($partner) # the parsed up-data attribute of the element we will discard
|
525
|
-
keepEventArgs = u.merge(
|
529
|
+
keepEventArgs = u.merge(plan, message: ['Keeping element %o', $keepable.get(0)])
|
526
530
|
if up.bus.nobodyPrevents('up:fragment:keep', keepEventArgs)
|
527
|
-
|
531
|
+
plan
|
528
532
|
|
529
533
|
###*
|
530
534
|
Elements with an `up-keep` attribute will be persisted during
|
@@ -221,7 +221,7 @@ up.form = (($) ->
|
|
221
221
|
@param {Function(value, $field)|String} onChange
|
222
222
|
The callback to run when the field's value changes.
|
223
223
|
If given as a function, it must take two arguments (`value`, `$field`).
|
224
|
-
If given as a string, it will be evaled as
|
224
|
+
If given as a string, it will be evaled as JavaScript code in a context where
|
225
225
|
(`value`, `$field`) are set.
|
226
226
|
@return {Function}
|
227
227
|
A destructor function that removes the observe watch when called.
|
@@ -186,7 +186,7 @@ up.layout = (($) ->
|
|
186
186
|
element are visible for the user.
|
187
187
|
|
188
188
|
By default Unpoly will always reveal an element before
|
189
|
-
updating it with
|
189
|
+
updating it with JavaScript functions like [`up.replace`](/up.replace)
|
190
190
|
or UJS behavior like [`[up-target]`](/a-up-target).
|
191
191
|
|
192
192
|
\#\#\# How Unpoly finds the viewport
|
@@ -233,7 +233,7 @@ up.layout = (($) ->
|
|
233
233
|
snap = u.option(options.snap, config.snap)
|
234
234
|
|
235
235
|
viewportIsDocument = $viewport.is(document)
|
236
|
-
viewportHeight = if viewportIsDocument then u.clientSize().height else $viewport.
|
236
|
+
viewportHeight = if viewportIsDocument then u.clientSize().height else $viewport.outerHeight()
|
237
237
|
originalScrollPos = $viewport.scrollTop()
|
238
238
|
newScrollPos = originalScrollPos
|
239
239
|
|
@@ -249,8 +249,9 @@ up.layout = (($) ->
|
|
249
249
|
else
|
250
250
|
obstruction = { top: 0, bottom: 0 }
|
251
251
|
# When the scrolled element is not <body> but instead a container
|
252
|
-
# with overflow-y: scroll, $.position returns the
|
253
|
-
# viewport's top edge instead of the
|
252
|
+
# with overflow-y: scroll, $.position returns the distance to the
|
253
|
+
# viewport's currently visible top edge (instead of the distance to
|
254
|
+
# the first row of the viewport's entire canvas buffer).
|
254
255
|
# http://codepen.io/anon/pen/jPojGE
|
255
256
|
offsetShift = originalScrollPos
|
256
257
|
|
@@ -259,7 +260,6 @@ up.layout = (($) ->
|
|
259
260
|
|
260
261
|
elementDims = u.measure($element, relative: $viewport)
|
261
262
|
firstElementRow = elementDims.top + offsetShift
|
262
|
-
|
263
263
|
lastElementRow = firstElementRow + Math.min(elementDims.height, config.substance) - 1
|
264
264
|
|
265
265
|
if lastElementRow > predictLastVisibleRow()
|
@@ -270,7 +270,7 @@ up.layout = (($) ->
|
|
270
270
|
# If the full element does not fit, scroll to the first row
|
271
271
|
newScrollPos = firstElementRow - obstruction.top
|
272
272
|
|
273
|
-
if newScrollPos < snap
|
273
|
+
if newScrollPos < snap && elementDims.top < (0.5 * viewportHeight)
|
274
274
|
newScrollPos = 0
|
275
275
|
|
276
276
|
if newScrollPos != originalScrollPos
|
@@ -416,7 +416,7 @@ up.layout = (($) ->
|
|
416
416
|
###*
|
417
417
|
@function up.layout.revealOrRestoreScroll
|
418
418
|
@return {Deferred}
|
419
|
-
A promise for when the revealing or scroll
|
419
|
+
A promise for when the revealing or scroll restoration ends
|
420
420
|
@internal
|
421
421
|
###
|
422
422
|
revealOrRestoreScroll = (selectorOrElement, options) ->
|
@@ -424,13 +424,16 @@ up.layout = (($) ->
|
|
424
424
|
if options.restoreScroll
|
425
425
|
restoreScroll(around: $element)
|
426
426
|
else if options.reveal
|
427
|
+
revealOptions = {}
|
427
428
|
if options.source
|
428
429
|
parsed = u.parseUrl(options.source)
|
429
430
|
if parsed.hash && parsed.hash != '#'
|
430
431
|
id = parsed.hash.substr(1)
|
431
432
|
$target = u.findWithSelf($element, "##{id}, a[name='#{id}']")
|
432
|
-
|
433
|
-
|
433
|
+
if $target.length
|
434
|
+
$element = $target
|
435
|
+
revealOptions.top = true
|
436
|
+
reveal($element, revealOptions)
|
434
437
|
else
|
435
438
|
u.resolvedDeferred()
|
436
439
|
|
@@ -6,7 +6,7 @@ Standard HTML links are a poor fit for modern applications:
|
|
6
6
|
|
7
7
|
- State changes caused by AJAX updates get lost during the page transition.
|
8
8
|
- Unsaved form changes get lost during the page transition.
|
9
|
-
- The
|
9
|
+
- The JavaScript VM is reset during the page transition.
|
10
10
|
- If the page layout is composed from multiple srollable containers
|
11
11
|
(e.g. a pane view), the scroll positions get lost during the page transition.
|
12
12
|
- The user sees a "flash" as the browser loads and renders the new page,
|
@@ -62,7 +62,7 @@ with an `up-target` attribute:
|
|
62
62
|
Note that instead of `article` you can use any other CSS selector like `#main .article`.
|
63
63
|
|
64
64
|
With these [`up-target`](/a-up-target) annotations Unpoly only updates the targeted part of the screen.
|
65
|
-
The
|
65
|
+
The JavaScript environment will persist and the user will not see a white flash while the
|
66
66
|
new page is loading.
|
67
67
|
|
68
68
|
|
@@ -73,7 +73,7 @@ new page is loading.
|
|
73
73
|
- As you switch through pages, Unpoly will [update your browser's location bar and history](/up.history)
|
74
74
|
- You can [open fragments in popups or modal dialogs](/up.modal).
|
75
75
|
- You can give users [immediate feedback](/up.navigation) when a link is clicked or becomes current, without waiting for the server.
|
76
|
-
- [Controlling Unpoly pragmatically through
|
76
|
+
- [Controlling Unpoly pragmatically through JavaScript](/up.flow)
|
77
77
|
- [Defining custom tags](/up.syntax)
|
78
78
|
|
79
79
|
|
@@ -252,17 +252,31 @@ up.link = (($) ->
|
|
252
252
|
up.bus.consumeAction(event)
|
253
253
|
handlerWithActiveMark($link)
|
254
254
|
|
255
|
-
|
255
|
+
###*
|
256
|
+
Returns whether the given link will be handled by Unpoly instead of making a full page load.
|
257
|
+
|
258
|
+
A link will be handled by Unpoly if it has an attribute
|
259
|
+
like `up-target` or `up-modal`.
|
260
|
+
|
261
|
+
@function up.link.isFollowable
|
262
|
+
@param {Element|jQuery|String} linkOrSelector
|
263
|
+
The link to check.
|
264
|
+
@experimental
|
265
|
+
###
|
266
|
+
isFollowable = (link) ->
|
267
|
+
$link = $(link)
|
256
268
|
u.any followVariantSelectors, (selector) -> $link.is(selector)
|
257
269
|
|
258
270
|
###*
|
259
|
-
Makes sure that the given link
|
271
|
+
Makes sure that the given link will be handled by Unpoly instead of making a full page load.
|
260
272
|
|
261
273
|
This is done by giving the link an `up-follow` attribute
|
262
|
-
unless it already have it an `up-target` or `up-
|
274
|
+
unless it already have it an attribute like `up-target` or `up-modal`.
|
263
275
|
|
264
276
|
@function up.link.makeFollowable
|
265
|
-
@
|
277
|
+
@param {Element|jQuery|String} linkOrSelector
|
278
|
+
The link to process.
|
279
|
+
@experimental
|
266
280
|
###
|
267
281
|
makeFollowable = (link) ->
|
268
282
|
$link = $(link)
|
@@ -525,6 +539,7 @@ up.link = (($) ->
|
|
525
539
|
visit: visit
|
526
540
|
follow: follow
|
527
541
|
makeFollowable: makeFollowable
|
542
|
+
isFollowable: isFollowable
|
528
543
|
shouldProcessLinkEvent: shouldProcessLinkEvent
|
529
544
|
childClicked: childClicked
|
530
545
|
followMethod: followMethod
|
@@ -41,7 +41,7 @@ up.log = (($) ->
|
|
41
41
|
###
|
42
42
|
config = u.config
|
43
43
|
prefix: '[UP] '
|
44
|
-
enabled:
|
44
|
+
enabled: (b.sessionStorage().getItem(SESSION_KEY_ENABLED) == 'true')
|
45
45
|
collapse: false
|
46
46
|
|
47
47
|
reset = ->
|
@@ -126,7 +126,8 @@ up.log = (($) ->
|
|
126
126
|
up.on 'up:framework:reset', reset
|
127
127
|
|
128
128
|
setEnabled = (value) ->
|
129
|
-
|
129
|
+
# Session storage can only store string values
|
130
|
+
b.sessionStorage().setItem(SESSION_KEY_ENABLED, value.toString())
|
130
131
|
config.enabled = value
|
131
132
|
|
132
133
|
###*
|
@@ -122,7 +122,6 @@ up.modal = (($) ->
|
|
122
122
|
###
|
123
123
|
config = u.config
|
124
124
|
maxWidth: null
|
125
|
-
minWidth: null
|
126
125
|
width: null
|
127
126
|
height: null
|
128
127
|
history: true
|
@@ -638,7 +637,7 @@ up.modal = (($) ->
|
|
638
637
|
Clicking this link will load the destination via AJAX and open
|
639
638
|
the given selector in a modal dialog.
|
640
639
|
|
641
|
-
|
640
|
+
\#\#\# Example
|
642
641
|
|
643
642
|
<a href="/blogs" up-modal=".blog-list">Switch blog</a>
|
644
643
|
|
@@ -718,17 +717,16 @@ up.modal = (($) ->
|
|
718
717
|
|
719
718
|
<a href="/fallback" up-close>Okay</a>
|
720
719
|
|
721
|
-
@selector [up-close]
|
720
|
+
@selector .up-modal [up-close]
|
722
721
|
@stable
|
723
722
|
###
|
724
|
-
up.on('click', '[up-close]', (event, $element) ->
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
up.bus.consumeAction(event)
|
723
|
+
up.on('click', '.up-modal [up-close]', (event, $element) ->
|
724
|
+
closeAsap()
|
725
|
+
# If the user closes the modal by clicking on the background, we want to halt the event chain here.
|
726
|
+
# The event should not trigger anything else. The user needs to click again for another interaction.
|
727
|
+
# Also only prevent the default when we actually closed a modal.
|
728
|
+
# This way we can have buttons that close a modal when within a modal, but link to a destination if not.
|
729
|
+
up.bus.consumeAction(event)
|
732
730
|
)
|
733
731
|
|
734
732
|
###*
|
@@ -737,7 +735,7 @@ up.modal = (($) ->
|
|
737
735
|
|
738
736
|
You can configure drawers using the [`up.modal.flavors.drawer`](/up.modal.flavors.drawer) property.
|
739
737
|
|
740
|
-
|
738
|
+
\#\#\# Example
|
741
739
|
|
742
740
|
<a href="/blogs" up-drawer=".blog-list">Switch blog</a>
|
743
741
|
|
@@ -755,7 +753,7 @@ up.modal = (($) ->
|
|
755
753
|
Valid values are `'left'`, `'right'` and `'auto'`. If set to `'auto'`, the
|
756
754
|
drawer will slide in from left if the opening link is on the left half of the screen.
|
757
755
|
Otherwise it will slide in from the right.
|
758
|
-
@
|
756
|
+
@stable
|
759
757
|
###
|
760
758
|
up.macro '[up-drawer]', ($link) ->
|
761
759
|
target = $link.attr('up-drawer')
|
@@ -2,7 +2,7 @@
|
|
2
2
|
Animation
|
3
3
|
=========
|
4
4
|
|
5
|
-
Whenever you [update a page fragment](/up
|
5
|
+
Whenever you [update a page fragment](/up.link) you can animate the change.
|
6
6
|
|
7
7
|
Let's say you are using an [`up-target`](/a-up-target) link to update an element
|
8
8
|
with content from the server. You can add an attribute [`up-transition`](/a-up-target#up-transition)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
###*
|
2
|
-
Navigation
|
3
|
-
|
2
|
+
Navigation feedback
|
3
|
+
===================
|
4
4
|
|
5
5
|
Unpoly automatically adds CSS classes to links while they are
|
6
6
|
currently loading ([`.up-active`](/up-active)) or
|
@@ -135,7 +135,7 @@ up.navigation = (($) ->
|
|
135
135
|
Marks the given element as currently loading, by assigning the CSS class [`up-active`](/up-active).
|
136
136
|
|
137
137
|
This happens automatically when following links or submitting forms through the Unpoly API.
|
138
|
-
Use this function if you make custom network calls from your own
|
138
|
+
Use this function if you make custom network calls from your own JavaScript code.
|
139
139
|
|
140
140
|
If the given element is a link within an [expanded click area](/up-expand),
|
141
141
|
the class will be assigned to the expanded area.
|
@@ -211,7 +211,7 @@ up.navigation = (($) ->
|
|
211
211
|
Marks the given element as no longer loading, by removing the CSS class [`up-active`](/up-active).
|
212
212
|
|
213
213
|
This happens automatically when network requests initiated by the Unpoly API have completed.
|
214
|
-
Use this function if you make custom network calls from your own
|
214
|
+
Use this function if you make custom network calls from your own JavaScript code.
|
215
215
|
|
216
216
|
@function up.navigation.stop
|
217
217
|
@param {jQuery} event.$element
|
@@ -255,7 +255,7 @@ up.navigation = (($) ->
|
|
255
255
|
- the link's [`up-href`](#turn-any-element-into-a-link) attribute
|
256
256
|
- a space-separated list of URLs in the link's `up-alias` attribute
|
257
257
|
|
258
|
-
|
258
|
+
\#\#\# Matching URL by prefix
|
259
259
|
|
260
260
|
You can mark a link as `.up-current` whenever the current URL matches a prefix.
|
261
261
|
To do so, end the `up-alias` attribute in an asterisk (`*`).
|
@@ -7,7 +7,7 @@ to show a fragment in a popup overlay that rolls down from an anchoring element.
|
|
7
7
|
|
8
8
|
To open a popup, add an [`up-popup` attribute](/up-popup) to a link:
|
9
9
|
|
10
|
-
<a href="/options" up-
|
10
|
+
<a href="/options" up-popup=".menu">Show options</a>
|
11
11
|
|
12
12
|
When this link is clicked, Unpoly will request the path `/options` and extract
|
13
13
|
an element matching the selector `.menu` from the response. The matching element
|
@@ -434,16 +434,15 @@ up.popup = (($) ->
|
|
434
434
|
|
435
435
|
<a href="/fallback" up-close>Okay</a>
|
436
436
|
|
437
|
-
@selector [up-close]
|
437
|
+
@selector .up-popup [up-close]
|
438
438
|
@stable
|
439
439
|
###
|
440
|
-
up.on 'click', '[up-close]', (event, $element) ->
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
up.bus.consumeAction(event)
|
440
|
+
up.on 'click', '.up-popup [up-close]', (event, $element) ->
|
441
|
+
closeAsap()
|
442
|
+
# Only prevent the default when we actually closed a popup.
|
443
|
+
# This way we can have buttons that close a popup when within a popup,
|
444
|
+
# but link to a destination if not.
|
445
|
+
up.bus.consumeAction(event)
|
447
446
|
|
448
447
|
# The framework is reset between tests
|
449
448
|
up.on 'up:framework:reset', reset
|
@@ -6,7 +6,7 @@ Unpoly caches server responses for a few minutes,
|
|
6
6
|
making requests to these URLs return instantly.
|
7
7
|
|
8
8
|
All Unpoly functions and selectors go through this cache.
|
9
|
-
If you need to make cache-aware requests from your [custom
|
9
|
+
If you need to make cache-aware requests from your [custom JavaScript](/up.syntax),
|
10
10
|
use [`up.ajax`](/up.ajax).
|
11
11
|
|
12
12
|
\#\#\# How the cache is cleared
|
@@ -318,7 +318,7 @@ up.proxy = (($) ->
|
|
318
318
|
|
319
319
|
<div class="spinner">Please wait!</div>
|
320
320
|
|
321
|
-
Here is the
|
321
|
+
Here is the JavaScript to make it alive:
|
322
322
|
|
323
323
|
up.compiler('.spinner', function($element) {
|
324
324
|
|
@@ -1,11 +1,11 @@
|
|
1
1
|
###*
|
2
|
-
Custom
|
2
|
+
Custom JavaScript
|
3
3
|
=================
|
4
4
|
|
5
|
-
Every app needs a way to pair
|
5
|
+
Every app needs a way to pair JavaScript snippets with certain HTML elements,
|
6
6
|
in order to integrate libraries or implement custom behavior.
|
7
7
|
|
8
|
-
Unpoly lets you organize your
|
8
|
+
Unpoly lets you organize your JavaScript snippets using [compilers](/up.compiler).
|
9
9
|
|
10
10
|
For instance, to activate the [Masonry](http://masonry.desandro.com/) jQuery plugin for every element
|
11
11
|
with a `grid` class, use this compiler:
|
@@ -23,7 +23,7 @@ up.syntax = (($) ->
|
|
23
23
|
|
24
24
|
u = up.util
|
25
25
|
|
26
|
-
|
26
|
+
DESTRUCTIBLE_CLASS = 'up-destructible'
|
27
27
|
DESTRUCTORS_KEY = 'up-destructors'
|
28
28
|
|
29
29
|
compilers = []
|
@@ -48,14 +48,14 @@ up.syntax = (($) ->
|
|
48
48
|
\#\#\# Integrating jQuery plugins
|
49
49
|
|
50
50
|
`up.compiler` is a great way to integrate jQuery plugins.
|
51
|
-
Let's say your
|
51
|
+
Let's say your JavaScript plugin wants you to call `lightboxify()`
|
52
52
|
on links that should open a lightbox. You decide to
|
53
53
|
do this for all links with an `lightbox` class:
|
54
54
|
|
55
55
|
<a href="river.png" class="lightbox">River</a>
|
56
56
|
<a href="ocean.png" class="lightbox">Ocean</a>
|
57
57
|
|
58
|
-
This
|
58
|
+
This JavaScript will do exactly that:
|
59
59
|
|
60
60
|
up.compiler('a.lightbox', function($element) {
|
61
61
|
$element.lightboxify();
|
@@ -68,7 +68,7 @@ up.syntax = (($) ->
|
|
68
68
|
|
69
69
|
<clock></clock>
|
70
70
|
|
71
|
-
Here is the
|
71
|
+
Here is the JavaScript that inserts the current time into to these elements:
|
72
72
|
|
73
73
|
up.compiler('clock', function($element) {
|
74
74
|
var now = new Date();
|
@@ -79,7 +79,7 @@ up.syntax = (($) ->
|
|
79
79
|
\#\#\# Cleaning up after yourself
|
80
80
|
|
81
81
|
If your compiler returns a function, Unpoly will use this as a *destructor* to
|
82
|
-
clean up if the element leaves the DOM. Note that in Unpoly the same DOM ad
|
82
|
+
clean up if the element leaves the DOM. Note that in Unpoly the same DOM ad JavaScript environment
|
83
83
|
will persist through many page loads, so it's important to not create
|
84
84
|
[memory leaks](https://makandracards.com/makandra/31325-how-to-create-memory-leaks-in-jquery).
|
85
85
|
|
@@ -283,7 +283,7 @@ up.syntax = (($) ->
|
|
283
283
|
[]
|
284
284
|
|
285
285
|
addDestructor = ($jqueryElement, destructor) ->
|
286
|
-
$jqueryElement.addClass(
|
286
|
+
$jqueryElement.addClass(DESTRUCTIBLE_CLASS)
|
287
287
|
destructors = $jqueryElement.data(DESTRUCTORS_KEY) || []
|
288
288
|
destructors.push(destructor)
|
289
289
|
$jqueryElement.data(DESTRUCTORS_KEY, destructors)
|
@@ -327,12 +327,16 @@ up.syntax = (($) ->
|
|
327
327
|
@internal
|
328
328
|
###
|
329
329
|
clean = ($fragment) ->
|
330
|
-
u.findWithSelf($fragment, ".#{
|
330
|
+
u.findWithSelf($fragment, ".#{DESTRUCTIBLE_CLASS}").each ->
|
331
331
|
$element = $(this)
|
332
332
|
destructors = $element.data(DESTRUCTORS_KEY)
|
333
|
-
|
334
|
-
|
335
|
-
|
333
|
+
# Although destructible elements should always have an array of destructors, we might be
|
334
|
+
# destroying a clone of such an element. E.g. Unpoly creates a clone when keeping an
|
335
|
+
# [up-keep] element, and that clone still has the .up-destructible class.
|
336
|
+
if destructors
|
337
|
+
destructor() for destructor in destructors
|
338
|
+
$element.removeData(DESTRUCTORS_KEY)
|
339
|
+
$element.removeClass(DESTRUCTIBLE_CLASS)
|
336
340
|
|
337
341
|
###*
|
338
342
|
Checks if the given element has an [`up-data`](/up-data) attribute.
|
@@ -346,7 +350,7 @@ up.syntax = (($) ->
|
|
346
350
|
|
347
351
|
<span class="person" up-data="{ age: 18, name: 'Bob' }">Bob</span>
|
348
352
|
|
349
|
-
Calling `up.syntax.data` will deserialize the JSON string into a
|
353
|
+
Calling `up.syntax.data` will deserialize the JSON string into a JavaScript object:
|
350
354
|
|
351
355
|
up.syntax.data('.person') // returns { age: 18, name: 'Bob' }
|
352
356
|
|
@@ -356,7 +360,7 @@ up.syntax = (($) ->
|
|
356
360
|
The JSON-decoded value of the `up-data` attribute.
|
357
361
|
|
358
362
|
Returns an empty object (`{}`) if the element has no (or an empty) `up-data` attribute.
|
359
|
-
@
|
363
|
+
@stable
|
360
364
|
###
|
361
365
|
|
362
366
|
###*
|