unpoly-rails 2.0.0.pre.rc5 → 2.0.0.pre.rc6

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of unpoly-rails might be problematic. Click here for more details.

@@ -1 +1 @@
1
- (function(){var u,p,e,r,t,a,n,i,o,l,c,s,d,m,g=[].slice;u=up.util,up.migrate=(p=new up.Config(function(){return{logLevel:"warn"}}),c=function(e,r,t){var a;return a=function(){return d("Property { %s } has been renamed to { %s } (found in %o)",r,t,e)},Object.defineProperty(e,r,{get:function(){return a(),this[t]},set:function(e){return a(),this[t]=e}})},a=function(e,r,t){if(u.isDefined(e[r]))return d("Property { %s } has been renamed to { %s } (found in %o)",r,t,e),u.renameKey(e,r,t)},o={},i=function(e,r){return o[e]=r},r=function(e){var r;return(r=o[e])?(d("Event "+e+" has been renamed to "+r),r):e},t=function(e){return u.uniq(u.map(e,r))},l=function(e,r){return Object.defineProperty(up,e,{get:function(){return d("up."+e+" has been renamed to up."+r),up[r]}})},m={},d=function(e){var r,t,a,n;if(a=e,r=2<=arguments.length?g.call(arguments,1):[],t=u.sprintf.apply(u,[a].concat(g.call(r))),!m[t])return m[t]=!0,(n=up.log)[p.logLevel].apply(n,["DEPRECATION",a].concat(g.call(r)))},e=function(e,r){return d(e+" has been deprecated. Use "+r+" instead.")},n=function(e){var r,t;return t=Promise.resolve(),r=t.then,t.then=function(){return d(e+" is now a sync function"),r.apply(this,arguments)},t},s=function(){return p.reset()},up.on("up:framework:reset",s),{deprecated:e,renamedPackage:l,renamedProperty:c,formerlyAsync:n,renamedEvent:i,fixEventTypes:t,fixKey:a,warn:d,loaded:!0,config:p})}).call(this),function(){var t=[].slice;up.element.first=function(){var e,r;return e=1<=arguments.length?t.call(arguments,0):[],up.migrate.deprecated("up.element.first()","up.element.get()"),(r=up.element).get.apply(r,e)},up.element.createFromHtml=function(){var e,r;return e=1<=arguments.length?t.call(arguments,0):[],up.migrate.deprecated("up.element.createFromHtml","up.element.createFromHTML"),(r=up.element).createFromHTML.apply(r,e)}}.call(this),function(){var r=[].slice;up.migrate.renamedPackage("bus","event"),up.event.nobodyPrevents=function(){var e;return e=1<=arguments.length?r.call(arguments,0):[],up.migrate.deprecated("up.event.nobodyPrevents(type)","!up.emit(type).defaultPrevented"),!up.emit.apply(up,e).defaultPrevented}}.call(this),function(){up.migrate.renamedPackage("navigation","feedback"),up.migrate.renamedProperty(up.feedback.config,"navs","navSelectors")}.call(this),function(){up.migrate.renamedProperty(up.form.config,"fields","fieldSelectors"),up.migrate.renamedProperty(up.form.config,"submitButtons","submitButtonSelectors")}.call(this),function(){var p,t=[].slice;p=up.util,up.migrate.renamedPackage("flow","fragment"),up.migrate.renamedPackage("dom","fragment"),up.migrate.renamedProperty(up.fragment.config,"fallbacks","mainTargets"),up.migrate.handleResponseDocOptions=function(e){return up.migrate.fixKey(e,"html","document")},up.replace=function(e,r,t){return up.migrate.deprecated("up.replace(target, url)","up.navigate(target, { url })"),up.navigate(p.merge(t,{target:e,url:r}))},up.extract=function(e,r,t){return up.migrate.deprecated("up.extract(target, document)","up.navigate(target, { document })"),up.navigate(p.merge(t,{target:e,document:r}))},up.fragment.first=function(){var e,r;return e=1<=arguments.length?t.call(arguments,0):[],up.migrate.deprecated("up.fragment.first()","up.fragment.get()"),(r=up.fragment).get.apply(r,e)},up.first=up.fragment.first,up.migrate.handleScrollOptions=function(e){if(p.isUndefined(e.scroll)&&(p.isString(e.reveal)?(up.migrate.deprecated("Option { reveal: '"+e.reveal+"' }","{ scroll: '"+e.reveal+"' }"),e.scroll=e.reveal):!0===e.reveal?(up.migrate.deprecated("Option { reveal: true }","{ scroll: 'target' }"),e.scroll="target"):!1===e.reveal&&(up.migrate.deprecated("Option { reveal: false }","{ scroll: false }"),e.scroll=!1),p.isDefined(e.resetScroll)&&(up.migrate.deprecated("Option { resetScroll: true }","{ scroll: 'reset' }"),e.scroll="teset"),p.isDefined(e.restoreScroll)))return up.migrate.deprecated("Option { restoreScroll: true }","{ scroll: 'restore' }"),e.scroll="restore"},up.migrate.handleHistoryOption=function(e){if(p.isString(e.history)&&"auto"!==e.history)return up.migrate.warn("Passing a URL as { history } option is deprecated. Pass it as { location } instead."),e.location=e.history,e.history="auto"},up.migrate.handleRenderOptions=function(e){var r,t,a,n,u;for(up.migrate.handleHistoryOption(e),u=[],r=0,t=(n=["target","origin"]).length;r<t;r++)a=n[r],p.isJQuery(e[a])?(up.migrate.warn("Passing a jQuery collection as { %s } is deprecated. Pass it as a native element instead.",a),u.push(e[a]=up.element.get(e[a]))):u.push(void 0);return u}}.call(this),function(){up.migrate.renamedProperty(up.history.config,"popTargets","restoreTargets"),up.history.url=function(){return up.migrate.deprecated("up.history.url()","up.history.location"),up.history.location},up.migrate.renamedEvent("up:history:push","up:location:changed"),up.migrate.renamedEvent("up:history:pushed","up:location:changed"),up.migrate.renamedEvent("up:history:restore","up:location:changed"),up.migrate.renamedEvent("up:history:restored","up:location:changed"),up.migrate.renamedEvent("up:history:replaced","up:location:changed")}.call(this),function(){up.migrate.handleLayerOptions=function(e){var r,t,a,n;for(up.migrate.fixKey(e,"flavor","mode"),up.migrate.fixKey(e,"closable","dismissable"),up.migrate.fixKey(e,"closeLabel","dismissLabel"),t=0,a=(n=["width","maxWidth","height"]).length;t<a;t++)e[r=n[t]]&&up.migrate.warn("Layer option { "+r+" } has been removed. Use { size } or { class } instead.");if(e.sticky&&up.migrate.warn("Layer option { sticky } has been removed. Give links an [up-peel=false] attribute to prevent layer dismissal on click."),e.template&&up.migrate.warn("Layer option { template } has been removed. Use { class } or modify the layer HTML on up:layer:open."),"page"===e.layer&&(up.migrate.warn("Option { layer: 'page' } has been renamed to { layer: 'root' }."),e.layer="root"),"modal"===e.layer||"popup"===e.layer)return up.migrate.warn("Option { layer: '"+e.layer+"' } has been removed. Did you mean { layer: 'overlay' }?"),e.layer="overlay"},up.migrate.handleTetherOptions=function(e){var r,t,a;if(t=(a=e.position.split("-"))[0],r=a[1])return up.migrate.warn("The position value %o is deprecated. Use %o instead.",e.position,{position:t,align:r}),e.position=t,e.align=r},up.migrate.registerLayerCloser=function(t){return t.registerClickCloser("up-close",function(e,r){return up.migrate.deprecated("[up-close]","[up-dismiss]"),t.dismiss(e,r)})}}.call(this),function(){up.migrate.parseFollowOptions=function(e){return e.string("flavor"),e.string("width"),e.string("height"),e["boolean"]("closable"),e.booleanOrString("reveal"),e["boolean"]("resetScroll"),e["boolean"]("restoreScroll")}}.call(this),function(){var e,a;a=up.util,e=new Error("up.modal.flavors has been removed without direct replacement. You may give new layers a { class } or modify layer elements on up:layer:open."),up.modal=a.literal({visit:function(e,r){return null==r&&(r={}),up.migrate.deprecated("up.modal.visit(url)",'up.layer.open({ url, mode: "modal" })'),up.layer.open(a.merge(r,{url:e,mode:"modal"}))},follow:function(e,r){return null==r&&(r={}),up.migrate.deprecated("up.modal.follow(link)",'up.follow(link, { layer: "modal" })'),up.follow(e,a.merge(r,{layer:"modal"}))},extract:function(e,r,t){return null==t&&(t={}),up.migrate.deprecated("up.modal.extract(target, document)",'up.layer.open({ document, mode: "modal" })'),up.layer.open(a.merge(t,{target:e,html:r,layer:"modal"}))},close:function(e){return null==e&&(e={}),up.migrate.deprecated("up.modal.close()","up.layer.dismiss()"),up.layer.dismiss(null,e),up.migrate.formerlyAsync("up.layer.dismiss()")},url:function(){return up.migrate.deprecated("up.modal.url()","up.layer.location"),up.layer.location},coveredUrl:function(){var e;return up.migrate.deprecated("up.modal.coveredUrl()","up.layer.parent.location"),null!=(e=up.layer.parent)?e.location:void 0},get_config:function(){return up.migrate.deprecated("up.modal.config","up.layer.config.modal"),up.layer.config.modal},contains:function(e){return up.migrate.deprecated("up.modal.contains()","up.layer.contains()"),up.layer.contains(e)},isOpen:function(){return up.migrate.deprecated("up.modal.isOpen()","up.layer.isOverlay()"),up.layer.isOverlay()},get_flavors:function(){throw e},flavor:function(){throw e}}),up.migrate.renamedEvent("up:modal:open","up:layer:open"),up.migrate.renamedEvent("up:modal:opened","up:layer:opened"),up.migrate.renamedEvent("up:modal:close","up:layer:dismiss"),up.migrate.renamedEvent("up:modal:closed","up:layer:dismissed"),up.link.targetMacro("up-modal",{"up-layer":"modal"},function(){return up.migrate.deprecated("a[up-modal]","a[up-layer=modal]")}),up.link.targetMacro("up-drawer",{"up-layer":"drawer"},function(){return up.migrate.deprecated("a[up-drawer]","a[up-layer=drawer]")})}.call(this),function(){var r,t,a=[].slice;t=up.util,up.migrate.renamedPackage("proxy","network"),up.migrate.renamedEvent("up:proxy:load","up:request:load"),up.migrate.renamedEvent("up:proxy:received","up:request:loaded"),up.migrate.renamedEvent("up:proxy:loaded","up:request:loaded"),up.migrate.renamedEvent("up:proxy:fatal","up:request:fatal"),up.migrate.renamedEvent("up:proxy:aborted","up:request:aborted"),up.migrate.renamedEvent("up:proxy:slow","up:request:late"),up.migrate.renamedEvent("up:proxy:recover","up:request:recover"),r=function(){return up.migrate.deprecated("up.proxy.config.preloadDelay","up.link.config.preloadDelay")},Object.defineProperty(up.network.config,"preloadDelay",{get:function(){return r(),up.link.config.preloadDelay},set:function(e){return r(),up.link.config.preloadDelay=e}}),up.migrate.renamedProperty(up.network.config,"maxRequests","concurrency"),up.migrate.renamedProperty(up.network.config,"slowDelay","badResponseTime"),up.migrate.handleNetworkPreloadArgs=function(){var e,r;if(e=1<=arguments.length?a.call(arguments,0):[],t.isElementish(e[0]))return up.migrate.warn("up.proxy.preload(link) has been renamed to up.link.preload(link)"),(r=up.link).preload.apply(r,e)},up.migrate.handleRequestOptions=function(e){return up.migrate.fixKey(e,"data","params")},up.ajax=function(){var e,r;return e=1<=arguments.length?a.call(arguments,0):[],up.migrate.deprecated("up.ajax()","up.request()"),r=function(e){return e.text},up.request.apply(up,e).then(r)},up.network.clear=function(){return up.migrate.deprecated("up.proxy.clear()","up.cache.clear()"),up.cache.clear()},up.Request.prototype.navigate=function(){return up.migrate.deprecated("up.Request#navigate()","up.Request#loadPage()"),this.loadPage()},up.Response.prototype.isSuccess=function(){return up.migrate.deprecated("up.Response#isSuccess()","up.Response#ok"),this.ok},up.Response.prototype.isError=function(){return up.migrate.deprecated("up.Response#isError()","!up.Response#ok"),!this.ok}}.call(this),function(){var t;t=up.util,up.element,up.popup=t.literal({attach:function(e,r){return null==r&&(r={}),e=up.fragment.get(e),up.migrate.deprecated("up.popup.attach(origin)","up.layer.open({ origin, layer: 'popup' })"),up.layer.open(t.merge(r,{origin:e,layer:"popup"}))},close:function(e){return null==e&&(e={}),up.migrate.deprecated("up.popup.close()","up.layer.dismiss()"),up.layer.dismiss(null,e)},url:function(){return up.migrate.deprecated("up.popup.url()","up.layer.location"),up.layer.location},coveredUrl:function(){var e;return up.migrate.deprecated("up.popup.coveredUrl()","up.layer.parent.location"),null!=(e=up.layer.parent)?e.location:void 0},get_config:function(){return up.migrate.deprecated("up.popup.config","up.layer.config.popup"),up.layer.config.popup},contains:function(e){return up.migrate.deprecated("up.popup.contains()","up.layer.contains()"),up.layer.contains(e)},isOpen:function(){return up.migrate.deprecated("up.popup.isOpen()","up.layer.isOverlay()"),up.layer.isOverlay()},sync:function(){return up.migrate.deprecated("up.popup.sync()","up.layer.sync()"),up.layer.sync()}}),up.migrate.renamedEvent("up:popup:open","up:layer:open"),up.migrate.renamedEvent("up:popup:opened","up:layer:opened"),up.migrate.renamedEvent("up:popup:close","up:layer:dismiss"),up.migrate.renamedEvent("up:popup:closed","up:layer:dismissed"),up.link.targetMacro("up-popup",{"up-layer":"popup"},function(){return up.migrate.deprecated("[up-popup]","[up-layer=popup]")})}.call(this),function(){up.migrate.renamedProperty(up.radio.config,"hungry","hungrySelectors")}.call(this),function(){up.tooltip=up.macro("[up-tooltip]",function(e){return up.migrate.warn("[up-tooltip] has been deprecated. A [title] was set instead."),up.element.setMissingAttr(e,"title",e.getAttribute("up-tooltip"))})}.call(this),function(){var a=[].slice;up.util.only=function(e){var r,t;return t=e,r=2<=arguments.length?a.call(arguments,1):[],up.migrate.deprecated("up.util.only(object, ...keys)","up.util.pick(object, keys)"),up.util.pick(t,r)},up.util.except=function(e){var r,t;return t=e,r=2<=arguments.length?a.call(arguments,1):[],up.migrate.deprecated("up.util.except(object, ...keys)","up.util.omit(object, keys)"),up.util.omit(t,r)},up.util.parseUrl=function(){var e,r;return e=1<=arguments.length?a.call(arguments,0):[],up.migrate.warn("up.util.parseUrl() has been renamed to up.util.parseURL()"),(r=up.util).parseURL.apply(r,e)},up.util.any=function(){var e;return e=1<=arguments.length?a.call(arguments,0):[],up.migrate.warn("up.util.any() has been renamed to up.util.some()"),some.apply(null,e)},up.util.all=function(){var e,r;return e=1<=arguments.length?a.call(arguments,0):[],up.migrate.warn("up.util.all() has been renamed to up.util.every()"),(r=up.util).every.apply(r,e)},up.util.detect=function(){var e,r;return e=1<=arguments.length?a.call(arguments,0):[],up.migrate.warn("up.util.detect() has been renamed to up.util.find()"),(r=up.util).find.apply(r,e)},up.util.select=function(){var e,r;return e=1<=arguments.length?a.call(arguments,0):[],up.migrate.warn("up.util.select() has been renamed to up.util.filter()"),(r=up.util).filter.apply(r,e)},up.util.setTimer=function(){var e,r;return e=1<=arguments.length?a.call(arguments,0):[],up.migrate.warn("up.util.setTimer() has been renamed to up.util.timer()"),(r=up.util).timer.apply(r,e)},up.util.escapeHtml=function(){var e,r;return e=1<=arguments.length?a.call(arguments,0):[],up.migrate.deprecated("up.util.escapeHtml","up.util.escapeHTML"),(r=up.util).escapeHTML.apply(r,e)},up.util.selectorForElement=function(){var e,r;return e=1<=arguments.length?a.call(arguments,0):[],up.migrate.warn("up.util.selectorForElement() has been renamed to up.fragment.toTarget()"),(r=up.fragment).toTarget.apply(r,e)},up.util.nextFrame=function(){var e,r;return e=1<=arguments.length?a.call(arguments,0):[],up.migrate.warn("up.util.nextFrame() has been renamed to up.util.task()"),(r=up.util).task.apply(r,e)}}.call(this),function(){var t=[].slice;up.migrate.renamedPackage("layout","viewport"),up.migrate.renamedProperty(up.viewport.config,"viewports","viewportSelectors"),up.migrate.renamedProperty(up.viewport.config,"snap","revealSnap"),up.viewport.closest=function(){var e,r;return e=1<=arguments.length?t.call(arguments,0):[],up.migrate.deprecated("up.viewport.closest()","up.viewport.get()"),(r=up.viewport).get.apply(r,e)}}.call(this),function(){}.call(this);
1
+ (function(){up.framework.startExtension()}).call(this),function(){var u,p,e,t,r,a,n,i,o,l,c,s,d,m,g=[].slice;u=up.util,up.migrate=(p=new up.Config(function(){return{logLevel:"warn"}}),c=function(e,t,r){var a;return a=function(){return d("Property { %s } has been renamed to { %s } (found in %o)",t,r,e)},Object.defineProperty(e,t,{get:function(){return a(),this[r]},set:function(e){return a(),this[r]=e}})},a=function(e,t,r){if(u.isDefined(e[t]))return d("Property { %s } has been renamed to { %s } (found in %o)",t,r,e),u.renameKey(e,t,r)},o={},i=function(e,t){return o[e]=t},t=function(e){var t;return(t=o[e])?(d("Event "+e+" has been renamed to "+t),t):e},r=function(e){return u.uniq(u.map(e,t))},l=function(e,t){return Object.defineProperty(up,e,{get:function(){return d("up."+e+" has been renamed to up."+t),up[t]}})},m={},d=function(e){var t,r,a,n;if(a=e,t=2<=arguments.length?g.call(arguments,1):[],r=u.sprintf.apply(u,[a].concat(g.call(t))),!m[r])return m[r]=!0,(n=up.log)[p.logLevel].apply(n,["DEPRECATION",a].concat(g.call(t)))},e=function(e,t){return d(e+" has been deprecated. Use "+t+" instead.")},n=function(e){var t,r;return r=Promise.resolve(),t=r.then,r.then=function(){return d(e+" is now a sync function"),t.apply(this,arguments)},r},s=function(){return p.reset()},up.on("up:framework:reset",s),{deprecated:e,renamedPackage:l,renamedProperty:c,formerlyAsync:n,renamedEvent:i,fixEventTypes:r,fixKey:a,warn:d,loaded:!0,config:p})}.call(this),function(){var a=[].slice;up.util.only=function(e){var t,r;return r=e,t=2<=arguments.length?a.call(arguments,1):[],up.migrate.deprecated("up.util.only(object, ...keys)","up.util.pick(object, keys)"),up.util.pick(r,t)},up.util.except=function(e){var t,r;return r=e,t=2<=arguments.length?a.call(arguments,1):[],up.migrate.deprecated("up.util.except(object, ...keys)","up.util.omit(object, keys)"),up.util.omit(r,t)},up.util.parseUrl=function(){var e,t;return e=1<=arguments.length?a.call(arguments,0):[],up.migrate.warn("up.util.parseUrl() has been renamed to up.util.parseURL()"),(t=up.util).parseURL.apply(t,e)},up.util.any=function(){var e;return e=1<=arguments.length?a.call(arguments,0):[],up.migrate.warn("up.util.any() has been renamed to up.util.some()"),some.apply(null,e)},up.util.all=function(){var e,t;return e=1<=arguments.length?a.call(arguments,0):[],up.migrate.warn("up.util.all() has been renamed to up.util.every()"),(t=up.util).every.apply(t,e)},up.util.detect=function(){var e,t;return e=1<=arguments.length?a.call(arguments,0):[],up.migrate.warn("up.util.detect() has been renamed to up.util.find()"),(t=up.util).find.apply(t,e)},up.util.select=function(){var e,t;return e=1<=arguments.length?a.call(arguments,0):[],up.migrate.warn("up.util.select() has been renamed to up.util.filter()"),(t=up.util).filter.apply(t,e)},up.util.setTimer=function(){var e,t;return e=1<=arguments.length?a.call(arguments,0):[],up.migrate.warn("up.util.setTimer() has been renamed to up.util.timer()"),(t=up.util).timer.apply(t,e)},up.util.escapeHtml=function(){var e,t;return e=1<=arguments.length?a.call(arguments,0):[],up.migrate.deprecated("up.util.escapeHtml","up.util.escapeHTML"),(t=up.util).escapeHTML.apply(t,e)},up.util.selectorForElement=function(){var e,t;return e=1<=arguments.length?a.call(arguments,0):[],up.migrate.warn("up.util.selectorForElement() has been renamed to up.fragment.toTarget()"),(t=up.fragment).toTarget.apply(t,e)},up.util.nextFrame=function(){var e,t;return e=1<=arguments.length?a.call(arguments,0):[],up.migrate.warn("up.util.nextFrame() has been renamed to up.util.task()"),(t=up.util).task.apply(t,e)}}.call(this),function(){var r=[].slice;up.element.first=function(){var e,t;return e=1<=arguments.length?r.call(arguments,0):[],up.migrate.deprecated("up.element.first()","up.element.get()"),(t=up.element).get.apply(t,e)},up.element.createFromHtml=function(){var e,t;return e=1<=arguments.length?r.call(arguments,0):[],up.migrate.deprecated("up.element.createFromHtml","up.element.createFromHTML"),(t=up.element).createFromHTML.apply(t,e)}}.call(this),function(){var t=[].slice;up.migrate.renamedPackage("bus","event"),up.event.nobodyPrevents=function(){var e;return e=1<=arguments.length?t.call(arguments,0):[],up.migrate.deprecated("up.event.nobodyPrevents(type)","!up.emit(type).defaultPrevented"),!up.emit.apply(up,e).defaultPrevented}}.call(this),function(){up.migrate.renamedProperty(up.form.config,"fields","fieldSelectors"),up.migrate.renamedProperty(up.form.config,"submitButtons","submitButtonSelectors")}.call(this),function(){var p,r=[].slice;p=up.util,up.migrate.renamedPackage("flow","fragment"),up.migrate.renamedPackage("dom","fragment"),up.migrate.renamedProperty(up.fragment.config,"fallbacks","mainTargets"),up.migrate.handleResponseDocOptions=function(e){return up.migrate.fixKey(e,"html","document")},up.replace=function(e,t,r){return up.migrate.deprecated("up.replace(target, url)","up.navigate(target, { url })"),up.navigate(p.merge(r,{target:e,url:t}))},up.extract=function(e,t,r){return up.migrate.deprecated("up.extract(target, document)","up.navigate(target, { document })"),up.navigate(p.merge(r,{target:e,document:t}))},up.fragment.first=function(){var e,t;return e=1<=arguments.length?r.call(arguments,0):[],up.migrate.deprecated("up.fragment.first()","up.fragment.get()"),(t=up.fragment).get.apply(t,e)},up.first=up.fragment.first,up.migrate.handleScrollOptions=function(e){if(p.isUndefined(e.scroll)&&(p.isString(e.reveal)?(up.migrate.deprecated("Option { reveal: '"+e.reveal+"' }","{ scroll: '"+e.reveal+"' }"),e.scroll=e.reveal):!0===e.reveal?(up.migrate.deprecated("Option { reveal: true }","{ scroll: 'target' }"),e.scroll="target"):!1===e.reveal&&(up.migrate.deprecated("Option { reveal: false }","{ scroll: false }"),e.scroll=!1),p.isDefined(e.resetScroll)&&(up.migrate.deprecated("Option { resetScroll: true }","{ scroll: 'reset' }"),e.scroll="teset"),p.isDefined(e.restoreScroll)))return up.migrate.deprecated("Option { restoreScroll: true }","{ scroll: 'restore' }"),e.scroll="restore"},up.migrate.handleHistoryOption=function(e){if(p.isString(e.history)&&"auto"!==e.history)return up.migrate.warn("Passing a URL as { history } option is deprecated. Pass it as { location } instead."),e.location=e.history,e.history="auto"},up.migrate.handleRenderOptions=function(e){var t,r,a,n,u;for(up.migrate.handleHistoryOption(e),u=[],t=0,r=(n=["target","origin"]).length;t<r;t++)a=n[t],p.isJQuery(e[a])?(up.migrate.warn("Passing a jQuery collection as { %s } is deprecated. Pass it as a native element instead.",a),u.push(e[a]=up.element.get(e[a]))):u.push(void 0);return u}}.call(this),function(){up.migrate.renamedProperty(up.history.config,"popTargets","restoreTargets"),up.history.url=function(){return up.migrate.deprecated("up.history.url()","up.history.location"),up.history.location},up.migrate.renamedEvent("up:history:push","up:location:changed"),up.migrate.renamedEvent("up:history:pushed","up:location:changed"),up.migrate.renamedEvent("up:history:restore","up:location:changed"),up.migrate.renamedEvent("up:history:restored","up:location:changed"),up.migrate.renamedEvent("up:history:replaced","up:location:changed")}.call(this),function(){up.migrate.renamedPackage("navigation","feedback"),up.migrate.renamedProperty(up.feedback.config,"navs","navSelectors")}.call(this),function(){up.migrate.parseFollowOptions=function(e){return e.string("flavor"),e.string("width"),e.string("height"),e["boolean"]("closable"),e.booleanOrString("reveal"),e["boolean"]("resetScroll"),e["boolean"]("restoreScroll")}}.call(this),function(){up.migrate.handleLayerOptions=function(e){var t,r,a,n;for(up.migrate.fixKey(e,"flavor","mode"),up.migrate.fixKey(e,"closable","dismissable"),up.migrate.fixKey(e,"closeLabel","dismissLabel"),r=0,a=(n=["width","maxWidth","height"]).length;r<a;r++)e[t=n[r]]&&up.migrate.warn("Layer option { "+t+" } has been removed. Use { size } or { class } instead.");if(e.sticky&&up.migrate.warn("Layer option { sticky } has been removed. Give links an [up-peel=false] attribute to prevent layer dismissal on click."),e.template&&up.migrate.warn("Layer option { template } has been removed. Use { class } or modify the layer HTML on up:layer:open."),"page"===e.layer&&(up.migrate.warn("Option { layer: 'page' } has been renamed to { layer: 'root' }."),e.layer="root"),"modal"===e.layer||"popup"===e.layer)return up.migrate.warn("Option { layer: '"+e.layer+"' } has been removed. Did you mean { layer: 'overlay' }?"),e.layer="overlay"},up.migrate.handleTetherOptions=function(e){var t,r,a;if(r=(a=e.position.split("-"))[0],t=a[1])return up.migrate.warn("The position value %o is deprecated. Use %o instead.",e.position,{position:r,align:t}),e.position=r,e.align=t},up.migrate.registerLayerCloser=function(r){return r.registerClickCloser("up-close",function(e,t){return up.migrate.deprecated("[up-close]","[up-dismiss]"),r.dismiss(e,t)})},up.migrate.handleLayerConfig=function(e){return up.migrate.fixKey(e,"history","historyVisible")}}.call(this),function(){var e,a;a=up.util,e=new Error("up.modal.flavors has been removed without direct replacement. You may give new layers a { class } or modify layer elements on up:layer:open."),up.modal=a.literal({visit:function(e,t){return null==t&&(t={}),up.migrate.deprecated("up.modal.visit(url)",'up.layer.open({ url, mode: "modal" })'),up.layer.open(a.merge(t,{url:e,mode:"modal"}))},follow:function(e,t){return null==t&&(t={}),up.migrate.deprecated("up.modal.follow(link)",'up.follow(link, { layer: "modal" })'),up.follow(e,a.merge(t,{layer:"modal"}))},extract:function(e,t,r){return null==r&&(r={}),up.migrate.deprecated("up.modal.extract(target, document)",'up.layer.open({ document, mode: "modal" })'),up.layer.open(a.merge(r,{target:e,html:t,layer:"modal"}))},close:function(e){return null==e&&(e={}),up.migrate.deprecated("up.modal.close()","up.layer.dismiss()"),up.layer.dismiss(null,e),up.migrate.formerlyAsync("up.layer.dismiss()")},url:function(){return up.migrate.deprecated("up.modal.url()","up.layer.location"),up.layer.location},coveredUrl:function(){var e;return up.migrate.deprecated("up.modal.coveredUrl()","up.layer.parent.location"),null!=(e=up.layer.parent)?e.location:void 0},get_config:function(){return up.migrate.deprecated("up.modal.config","up.layer.config.modal"),up.layer.config.modal},contains:function(e){return up.migrate.deprecated("up.modal.contains()","up.layer.contains()"),up.layer.contains(e)},isOpen:function(){return up.migrate.deprecated("up.modal.isOpen()","up.layer.isOverlay()"),up.layer.isOverlay()},get_flavors:function(){throw e},flavor:function(){throw e}}),up.migrate.renamedEvent("up:modal:open","up:layer:open"),up.migrate.renamedEvent("up:modal:opened","up:layer:opened"),up.migrate.renamedEvent("up:modal:close","up:layer:dismiss"),up.migrate.renamedEvent("up:modal:closed","up:layer:dismissed"),up.link.targetMacro("up-modal",{"up-layer":"new modal"},function(){return up.migrate.deprecated("a[up-modal]",'a[up-layer="new modal"]')}),up.link.targetMacro("up-drawer",{"up-layer":"new drawer"},function(){return up.migrate.deprecated("a[up-drawer]",'a[up-layer="new drawer"]')})}.call(this),function(){var r;r=up.util,up.element,up.popup=r.literal({attach:function(e,t){return null==t&&(t={}),e=up.fragment.get(e),up.migrate.deprecated("up.popup.attach(origin)","up.layer.open({ origin, layer: 'popup' })"),up.layer.open(r.merge(t,{origin:e,layer:"popup"}))},close:function(e){return null==e&&(e={}),up.migrate.deprecated("up.popup.close()","up.layer.dismiss()"),up.layer.dismiss(null,e)},url:function(){return up.migrate.deprecated("up.popup.url()","up.layer.location"),up.layer.location},coveredUrl:function(){var e;return up.migrate.deprecated("up.popup.coveredUrl()","up.layer.parent.location"),null!=(e=up.layer.parent)?e.location:void 0},get_config:function(){return up.migrate.deprecated("up.popup.config","up.layer.config.popup"),up.layer.config.popup},contains:function(e){return up.migrate.deprecated("up.popup.contains()","up.layer.contains()"),up.layer.contains(e)},isOpen:function(){return up.migrate.deprecated("up.popup.isOpen()","up.layer.isOverlay()"),up.layer.isOverlay()},sync:function(){return up.migrate.deprecated("up.popup.sync()","up.layer.sync()"),up.layer.sync()}}),up.migrate.renamedEvent("up:popup:open","up:layer:open"),up.migrate.renamedEvent("up:popup:opened","up:layer:opened"),up.migrate.renamedEvent("up:popup:close","up:layer:dismiss"),up.migrate.renamedEvent("up:popup:closed","up:layer:dismissed"),up.link.targetMacro("up-popup",{"up-layer":"new popup"},function(){return up.migrate.deprecated("[up-popup]",'[up-layer="new popup"]')})}.call(this),function(){up.tooltip=up.macro("[up-tooltip]",function(e){return up.migrate.warn("[up-tooltip] has been deprecated. A [title] was set instead."),up.element.setMissingAttr(e,"title",e.getAttribute("up-tooltip"))})}.call(this),function(){var t,r,a=[].slice;r=up.util,up.migrate.renamedPackage("proxy","network"),up.migrate.renamedEvent("up:proxy:load","up:request:load"),up.migrate.renamedEvent("up:proxy:received","up:request:loaded"),up.migrate.renamedEvent("up:proxy:loaded","up:request:loaded"),up.migrate.renamedEvent("up:proxy:fatal","up:request:fatal"),up.migrate.renamedEvent("up:proxy:aborted","up:request:aborted"),up.migrate.renamedEvent("up:proxy:slow","up:request:late"),up.migrate.renamedEvent("up:proxy:recover","up:request:recover"),t=function(){return up.migrate.deprecated("up.proxy.config.preloadDelay","up.link.config.preloadDelay")},Object.defineProperty(up.network.config,"preloadDelay",{get:function(){return t(),up.link.config.preloadDelay},set:function(e){return t(),up.link.config.preloadDelay=e}}),up.migrate.renamedProperty(up.network.config,"maxRequests","concurrency"),up.migrate.renamedProperty(up.network.config,"slowDelay","badResponseTime"),up.migrate.handleNetworkPreloadArgs=function(){var e,t;if(e=1<=arguments.length?a.call(arguments,0):[],r.isElementish(e[0]))return up.migrate.warn("up.proxy.preload(link) has been renamed to up.link.preload(link)"),(t=up.link).preload.apply(t,e)},up.migrate.handleRequestOptions=function(e){return up.migrate.fixKey(e,"data","params")},up.ajax=function(){var e,t;return e=1<=arguments.length?a.call(arguments,0):[],up.migrate.deprecated("up.ajax()","up.request()"),t=function(e){return e.text},up.request.apply(up,e).then(t)},up.network.clear=function(){return up.migrate.deprecated("up.proxy.clear()","up.cache.clear()"),up.cache.clear()},up.Request.prototype.navigate=function(){return up.migrate.deprecated("up.Request#navigate()","up.Request#loadPage()"),this.loadPage()},up.Response.prototype.isSuccess=function(){return up.migrate.deprecated("up.Response#isSuccess()","up.Response#ok"),this.ok},up.Response.prototype.isError=function(){return up.migrate.deprecated("up.Response#isError()","!up.Response#ok"),!this.ok}}.call(this),function(){up.migrate.renamedProperty(up.radio.config,"hungry","hungrySelectors")}.call(this),function(){var r=[].slice;up.migrate.renamedPackage("layout","viewport"),up.migrate.renamedProperty(up.viewport.config,"viewports","viewportSelectors"),up.migrate.renamedProperty(up.viewport.config,"snap","revealSnap"),up.viewport.closest=function(){var e,t;return e=1<=arguments.length?r.call(arguments,0):[],up.migrate.deprecated("up.viewport.closest()","up.viewport.get()"),(t=up.viewport).get.apply(t,e)}}.call(this),function(){up.framework.stopExtension()}.call(this),function(){}.call(this);
data/dist/unpoly.js CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  (function() {
7
7
  window.up = {
8
- version: "2.0.0-rc5"
8
+ version: "2.0.0-rc6"
9
9
  };
10
10
 
11
11
  }).call(this);
@@ -2313,6 +2313,14 @@ It complements [native `Element` methods](https://www.w3schools.com/jsref/dom_ob
2313
2313
  results.push.apply(results, all(root, selector));
2314
2314
  return results;
2315
2315
  };
2316
+
2317
+ /***
2318
+ Returns whether the given element is either the given root element
2319
+ or its descendants.
2320
+
2321
+ @function isInSubtree
2322
+ @internal
2323
+ */
2316
2324
  isInSubtree = function(root, selectorOrElement) {
2317
2325
  var element;
2318
2326
  element = getOne(selectorOrElement);
@@ -2347,6 +2355,9 @@ It complements [native `Element` methods](https://www.w3schools.com/jsref/dom_ob
2347
2355
  /***
2348
2356
  Returns whether the given element matches the given CSS selector.
2349
2357
 
2358
+ To match against a non-standard selector like `:main`,
2359
+ use `up.fragment.matches()` instead.
2360
+
2350
2361
  @function up.element.matches
2351
2362
  @param {Element} element
2352
2363
  The element to check.
@@ -2659,6 +2670,8 @@ It complements [native `Element` methods](https://www.w3schools.com/jsref/dom_ob
2659
2670
  Attach it with [`Element#appendChild()`](https://developer.mozilla.org/en-US/docs/Web/API/Node/appendChild)
2660
2671
  or use `up.element.affix()` to create an attached element.
2661
2672
 
2673
+ Use `up.hello()` to activate JavaScript behavior within the created element.
2674
+
2662
2675
  \#\#\# Examples
2663
2676
 
2664
2677
  To create an element with a given tag name:
@@ -2792,14 +2805,17 @@ It complements [native `Element` methods](https://www.w3schools.com/jsref/dom_ob
2792
2805
  /***
2793
2806
  Creates an element matching the given CSS selector and attaches it to the given parent element.
2794
2807
 
2795
- To create a detached element from a selector,
2796
- see `up.element.createFromSelector()`.
2808
+ To create a detached element from a selector, see `up.element.createFromSelector()`.
2809
+
2810
+ Use `up.hello()` to activate JavaScript behavior within the created element.
2797
2811
 
2798
2812
  \#\#\# Example
2799
2813
 
2800
- element = up.element.affix(document.body, '.klass')
2801
- element.parentElement // returns document.body
2802
- element.className // returns 'klass'
2814
+ ```js
2815
+ element = up.element.affix(document.body, '.klass')
2816
+ element.parentElement // returns document.body
2817
+ element.className // returns 'klass'
2818
+ ```
2803
2819
 
2804
2820
  @function up.element.affix
2805
2821
  @param {Element} parent
@@ -2909,12 +2925,16 @@ It complements [native `Element` methods](https://www.w3schools.com/jsref/dom_ob
2909
2925
  /***
2910
2926
  Creates an element from the given HTML fragment.
2911
2927
 
2928
+ Use `up.hello()` to activate JavaScript behavior within the created element.
2929
+
2912
2930
  \#\#\# Example
2913
2931
 
2914
- element = up.element.createFromHTML('<div class="foo"><span>text</span></div>')
2915
- element.className // returns 'foo'
2916
- element.children[0] // returns <span> element
2917
- element.children[0].textContent // returns 'text'
2932
+ ```js
2933
+ element = up.element.createFromHTML('<div class="foo"><span>text</span></div>')
2934
+ element.className // returns 'foo'
2935
+ element.children[0] // returns <span> element
2936
+ element.children[0].textContent // returns 'text'
2937
+ ```
2918
2938
 
2919
2939
  @function up.element.createFromHTML
2920
2940
  @stable
@@ -3365,6 +3385,7 @@ It complements [native `Element` methods](https://www.w3schools.com/jsref/dom_ob
3365
3385
  @function up.element.isVisible
3366
3386
  @param {Element} element
3367
3387
  The element to check.
3388
+ @return {boolean}
3368
3389
  @stable
3369
3390
  */
3370
3391
  isVisible = function(element) {
@@ -3384,6 +3405,15 @@ It complements [native `Element` methods](https://www.w3schools.com/jsref/dom_ob
3384
3405
  }
3385
3406
  return attrs;
3386
3407
  };
3408
+
3409
+ /***
3410
+ Returns whether the given element has been removed from the DOM tree.
3411
+
3412
+ up.element.isDetached
3413
+ @param {Element} element
3414
+ @return {boolean}
3415
+ @stable
3416
+ */
3387
3417
  isDetached = function(element) {
3388
3418
  return element !== document && !getRoot().contains(element);
3389
3419
  };
@@ -4535,7 +4565,7 @@ It complements [native `Element` methods](https://www.w3schools.com/jsref/dom_ob
4535
4565
  origin: this.origin,
4536
4566
  baseLayer: this.baseLayer,
4537
4567
  layerOptions: this.options,
4538
- log: "Opening new " + this.layer
4568
+ log: "Opening new overlay"
4539
4569
  });
4540
4570
  };
4541
4571
 
@@ -5416,7 +5446,7 @@ It complements [native `Element` methods](https://www.w3schools.com/jsref/dom_ob
5416
5446
  this.nativeCallback = bind(this.nativeCallback, this);
5417
5447
  EventListener.__super__.constructor.call(this, attributes);
5418
5448
  this.key = this.constructor.buildKey(attributes);
5419
- this.isDefault = up.framework.isBooting();
5449
+ this.isDefault = up.framework.booting;
5420
5450
  }
5421
5451
 
5422
5452
  EventListener.prototype.bind = function() {
@@ -6263,9 +6293,11 @@ It complements [native `Element` methods](https://www.w3schools.com/jsref/dom_ob
6263
6293
 
6264
6294
  \#\#\# Example
6265
6295
 
6266
- let layer = up.layer.current
6267
- layer.context.message = 'Please select a contact'
6268
- console.log(layer.context) // logs "{ message: 'Please select a contact' }"
6296
+ ```js
6297
+ let layer = up.layer.current
6298
+ layer.context.message = 'Please select a contact'
6299
+ console.log(layer.context) // logs "{ message: 'Please select a contact' }"
6300
+ ```
6269
6301
 
6270
6302
  \#\#\# Accessing the context from the server
6271
6303
 
@@ -6282,10 +6314,10 @@ It complements [native `Element` methods](https://www.w3schools.com/jsref/dom_ob
6282
6314
  /***
6283
6315
  Whether fragment updates within this layer will affect [browser history](/up.history).
6284
6316
 
6285
- If a layer does not affect history, its desendant layers cannot affect history either.
6317
+ If a layer does not have visible history, its desendant layers cannot have history either.
6286
6318
 
6287
- @property up.Layer#history
6288
- @param {boolean} history
6319
+ @property up.Layer#historyVisible
6320
+ @param {boolean} historyVisible
6289
6321
  @stable
6290
6322
  */
6291
6323
 
@@ -6409,7 +6441,7 @@ It complements [native `Element` methods](https://www.w3schools.com/jsref/dom_ob
6409
6441
 
6410
6442
 
6411
6443
  /***
6412
- [Dismisses](/up.Layer#dismiss) all descendant overlays,
6444
+ [Dismisses](/up.Layer.prototype.dismiss) all descendant overlays,
6413
6445
  making this layer the [frontmost layer](/up.layer.front) in the [layer stack](/up.layer.stack).
6414
6446
 
6415
6447
  Descendant overlays will be dismissed with value `':peel'`.
@@ -6744,7 +6776,7 @@ It complements [native `Element` methods](https://www.w3schools.com/jsref/dom_ob
6744
6776
 
6745
6777
 
6746
6778
  /***
6747
- [Emits](/up.emit) an event on [this layer's element](/up.Layer#element).
6779
+ [Emits](/up.emit) an event on [this layer's element](/up.Layer.prototype.element).
6748
6780
 
6749
6781
  The value of [up.layer.current](/up.layer.current) will be set to the this layer
6750
6782
  while event listeners are running.
@@ -6763,7 +6795,7 @@ It complements [native `Element` methods](https://www.w3schools.com/jsref/dom_ob
6763
6795
  @param {Element|jQuery} [target=this.element]
6764
6796
  The element on which the event is triggered.
6765
6797
 
6766
- If omitted, the event will be emitted on the [this layer's element](/up.Layer#element).
6798
+ If omitted, the event will be emitted on the [this layer's element](/up.Layer.prototype.element).
6767
6799
  @param {string} eventType
6768
6800
  The event type, e.g. `my:event`.
6769
6801
  @param {Object} [props={}]
@@ -6844,10 +6876,14 @@ It complements [native `Element` methods](https://www.w3schools.com/jsref/dom_ob
6844
6876
  /***
6845
6877
  This layer's window title.
6846
6878
 
6847
- If this layer does not [affect browser history](/up.Layer#history), this property will
6848
- still return the string the layer would otherwise use.
6879
+ If the [frontmost layer](/up.layer.front) does not have [visible history](/up.Layer.prototype.historyVisible),
6880
+ the browser window will show the title of an ancestor layer.
6881
+ This property will return the title the layer would use if it had visible history.
6849
6882
 
6850
- When this layer opens a child layer with history, the browser window will change to the child
6883
+ If this layer does not [affect browser history](/up.Layer.prototype.historyVisible), this property will
6884
+ still return the title the layer would otherwise use.
6885
+
6886
+ When this layer opens a child layer with visible history, the browser window will change to the child
6851
6887
  layer's title. When the child layer is closed, this layer's title will be restored.
6852
6888
 
6853
6889
  @property up.Layer#title
@@ -6873,13 +6909,14 @@ It complements [native `Element` methods](https://www.w3schools.com/jsref/dom_ob
6873
6909
 
6874
6910
 
6875
6911
  /***
6876
- This layer's URL for the browser's address bar.
6912
+ This layer's location URL.
6877
6913
 
6878
- If this layer does not [affect browser history](/up.Layer#history), this property will
6879
- still return the URL the layer would otherwise use.
6914
+ If the [frontmost layer](/up.layer.front) does not have [visible history](/up.Layer.prototype.historyVisible),
6915
+ the browser's address bar will show the location of an ancestor layer.
6916
+ This property will return the URL the layer would use if it had visible history.
6880
6917
 
6881
- When this layer opens a child layer with history, the browser URL will change to the child
6882
- layer's location. When the child layer is closed, this layer's laytion will be restored.
6918
+ When this layer opens a child layer with visible history, the browser URL will change to the child
6919
+ layer's location. When the child layer is closed, this layer's location will be restored.
6883
6920
 
6884
6921
  @property up.Layer#location
6885
6922
  @param {string} location
@@ -8408,8 +8445,8 @@ It complements [native `Element` methods](https://www.w3schools.com/jsref/dom_ob
8408
8445
  The `up.Params` class offers a consistent API to read and manipulate request parameters
8409
8446
  independent of their type.
8410
8447
 
8411
- Request parameters are used in [form submissions](/up.Params#fromForm) and
8412
- [URLs](/up.Params#fromURL). Methods like `up.submit()` or `up.replace()` accept
8448
+ Request parameters are used in [form submissions](/up.Params.prototype.fromForm) and
8449
+ [URLs](/up.Params.prototype.fromURL). Methods like `up.submit()` or `up.replace()` accept
8413
8450
  request parameters as a `{ params }` option.
8414
8451
 
8415
8452
  \#\#\# Supported parameter types
@@ -8765,7 +8802,7 @@ It complements [native `Element` methods](https://www.w3schools.com/jsref/dom_ob
8765
8802
  Sets the `value` for the entry with given `name`.
8766
8803
 
8767
8804
  An `up.Params` instance can hold multiple entries with the same name.
8768
- All existing entries with the given `name` are [deleted](/up.Params#delete) before the
8805
+ All existing entries with the given `name` are [deleted](/up.Params.prototype.delete) before the
8769
8806
  new entry is set. To add a new entry even if the `name` is taken, use `up.Params#add()`.
8770
8807
 
8771
8808
  @function up.Params#set
@@ -11034,9 +11071,9 @@ It complements [native `Element` methods](https://www.w3schools.com/jsref/dom_ob
11034
11071
 
11035
11072
  (function() {
11036
11073
  up.framework = (function() {
11037
- var boot, emitReset, isBooting, u;
11074
+ var boot, booting, emitReset, startExtension, stopExtension, u;
11038
11075
  u = up.util;
11039
- isBooting = true;
11076
+ booting = true;
11040
11077
 
11041
11078
  /***
11042
11079
  Resets Unpoly to the state when it was booted.
@@ -11077,7 +11114,7 @@ It complements [native `Element` methods](https://www.w3schools.com/jsref/dom_ob
11077
11114
  up.emit('up:framework:boot', {
11078
11115
  log: false
11079
11116
  });
11080
- isBooting = false;
11117
+ booting = false;
11081
11118
  return up.event.onReady(function() {
11082
11119
  return up.emit('up:app:boot', {
11083
11120
  log: 'Booting user application'
@@ -11087,13 +11124,21 @@ It complements [native `Element` methods](https://www.w3schools.com/jsref/dom_ob
11087
11124
  return typeof console.log === "function" ? console.log("Unpoly doesn't support this browser. Framework was not booted.") : void 0;
11088
11125
  }
11089
11126
  };
11090
- return {
11091
- reset: emitReset,
11127
+ startExtension = function() {
11128
+ return booting = true;
11129
+ };
11130
+ stopExtension = function() {
11131
+ return booting = false;
11132
+ };
11133
+ return u.literal({
11092
11134
  boot: boot,
11093
- isBooting: function() {
11094
- return isBooting;
11135
+ startExtension: startExtension,
11136
+ stopExtension: stopExtension,
11137
+ reset: emitReset,
11138
+ get_booting: function() {
11139
+ return booting;
11095
11140
  }
11096
- };
11141
+ });
11097
11142
  })();
11098
11143
 
11099
11144
  }).call(this);
@@ -11141,7 +11186,7 @@ document.addEventListener('up:modal:open', (event) => {
11141
11186
  var slice = [].slice;
11142
11187
 
11143
11188
  up.event = (function() {
11144
- var $bind, assertEmitted, bind, bindNow, build, buildEmitter, e, emit, escapePressed, executeEmitAttr, fork, halt, isUnmodified, keyModifiers, onEscape, onReady, reset, u, unbind;
11189
+ var $bind, assertEmitted, bind, bindNow, build, buildEmitter, e, emit, executeEmitAttr, fork, halt, isUnmodified, keyModifiers, onEscape, onReady, reset, u, unbind, wasEscapePressed;
11145
11190
  u = up.util;
11146
11191
  e = up.element;
11147
11192
  reset = function() {
@@ -11169,9 +11214,6 @@ document.addEventListener('up:modal:open', (event) => {
11169
11214
  - You use an [`[up-data]`](/up-data) attribute to [attach structured data](/up.on#attaching-structured-data)
11170
11215
  to observed elements. If an `[up-data]` attribute is set, its value will automatically be
11171
11216
  parsed as JSON and passed as a third argument.
11172
- - Event listeners on [unsupported browsers](/up.browser.isSupported) are silently discarded,
11173
- leaving you with an application without JavaScript. This is typically preferable to
11174
- a soup of randomly broken JavaScript in ancient browsers.
11175
11217
 
11176
11218
  \#\#\# Basic example
11177
11219
 
@@ -11263,39 +11305,47 @@ document.addEventListener('up:modal:open', (event) => {
11263
11305
  ```
11264
11306
 
11265
11307
  @function up.on
11308
+
11266
11309
  @param {Element|jQuery} [element=document]
11267
11310
  The element on which to register the event listener.
11268
11311
 
11269
11312
  If no element is given, the listener is registered on the `document`.
11313
+
11270
11314
  @param {string|Array<string>} types
11271
11315
  The event types to bind to.
11272
11316
 
11273
11317
  Multiple event types may be passed as either a space-separated string
11274
11318
  or as an array of types.
11319
+
11275
11320
  @param {string} [selector]
11276
11321
  The selector of an element on which the event must be triggered.
11277
11322
 
11278
11323
  Omit the selector to listen to all events of the given type, regardless
11279
11324
  of the event target.
11325
+
11280
11326
  @param {boolean} [options.passive=false]
11281
11327
  Whether to register a [passive event listener](https://developers.google.com/web/updates/2016/06/passive-event-listeners).
11282
11328
 
11283
11329
  A passive event listener may not call `event.preventDefault()`.
11284
11330
  This in particular may improve the frame rate when registering
11285
11331
  `touchstart` and `touchmove` events.
11332
+
11286
11333
  @param {boolean} [options.once=true]
11287
11334
  Whether the listener should run at most once.
11288
11335
 
11289
11336
  If `true` the listener will automatically be removed from the element
11290
11337
  after the first invocation.
11338
+
11291
11339
  @param {Function(event, [element], [data])} listener
11292
11340
  The listener function that should be called.
11293
11341
 
11294
11342
  The function takes the affected element as a second argument.
11295
11343
  If the element has an [`up-data`](/up-data) attribute, its value is parsed as JSON
11296
11344
  and passed as a third argument.
11345
+
11297
11346
  @return {Function()}
11298
11347
  A function that unbinds the event listeners when called.
11348
+
11299
11349
  @stable
11300
11350
  */
11301
11351
  bind = function() {
@@ -11422,7 +11472,7 @@ document.addEventListener('up:modal:open', (event) => {
11422
11472
  @param {up.Layer|string|number} [props.layer]
11423
11473
  The [layer](/up.layer) on which to emit this event.
11424
11474
 
11425
- If this property is set, the event will be emitted on the [layer's outmost element](/up.Layer#element).
11475
+ If this property is set, the event will be emitted on the [layer's outmost element](/up.Layer.prototype.element).
11426
11476
  Also [up.layer.current](/up.layer.current) will be set to the given layer while event listeners
11427
11477
  are running.
11428
11478
  @param {string|Array} [props.log]
@@ -11489,7 +11539,7 @@ document.addEventListener('up:modal:open', (event) => {
11489
11539
  };
11490
11540
 
11491
11541
  /***
11492
- [Emits](/up.emit) the given event and throws an AbortError if it was prevented.
11542
+ [Emits](/up.emit) the given event and throws an `AbortError` if it was prevented.
11493
11543
 
11494
11544
  @function up.event.assertEmitted
11495
11545
  @param {string} eventType
@@ -11522,7 +11572,7 @@ document.addEventListener('up:modal:open', (event) => {
11522
11572
  */
11523
11573
  onEscape = function(listener) {
11524
11574
  return bind('keydown', function(event) {
11525
- if (escapePressed(event)) {
11575
+ if (wasEscapePressed(event)) {
11526
11576
  return listener(event);
11527
11577
  }
11528
11578
  });
@@ -11531,11 +11581,11 @@ document.addEventListener('up:modal:open', (event) => {
11531
11581
  /***
11532
11582
  Returns whether the given keyboard event involved the ESC key.
11533
11583
 
11534
- @function up.util.escapePressed
11584
+ @function up.util.wasEscapePressed
11535
11585
  @param {Event} event
11536
11586
  @internal
11537
11587
  */
11538
- escapePressed = function(event) {
11588
+ wasEscapePressed = function(event) {
11539
11589
  var key;
11540
11590
  key = event.key;
11541
11591
  return key === 'Escape' || key === 'Esc';
@@ -11628,19 +11678,23 @@ document.addEventListener('up:modal:open', (event) => {
11628
11678
 
11629
11679
  \#\#\# Example
11630
11680
 
11631
- <a href='/users/5" up-emit='user:select' up-emit-props='{ "id": 5, "firstName": "Alice" }'>Alice</a>
11681
+ This hyperlink will emit an `user:select` event when clicked:
11632
11682
 
11633
- <script>
11634
- up.on('a', 'user:select', function(event) {
11635
- console.log(event.firstName) // logs "Alice"
11636
- event.preventDefault() // will prevent the link from being followed
11637
- })
11638
- </script>
11683
+ ```
11684
+ <a href='/users/5" up-emit='user:select' up-emit-props='{ "id": 5, "firstName": "Alice" }'>Alice</a>
11685
+
11686
+ <script>
11687
+ up.on('a', 'user:select', function(event) {
11688
+ console.log(event.firstName) // logs "Alice"
11689
+ event.preventDefault() // will prevent the link from being followed
11690
+ })
11691
+ </script>
11692
+ ```
11639
11693
 
11640
11694
  @selector a[up-emit]
11641
11695
  @param up-emit
11642
11696
  The type of the event to be emitted.
11643
- @param up-emit-props
11697
+ @param [up-emit-props='{}']
11644
11698
  The event properties, serialized as JSON.
11645
11699
  */
11646
11700
  executeEmitAttr = function(event, element) {
@@ -12973,7 +13027,7 @@ or when a matching fragment is [inserted via AJAX](/up.link) later.
12973
13027
  var args, macro;
12974
13028
  args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
12975
13029
  macro = buildCompiler(args);
12976
- if (up.framework.isBooting()) {
13030
+ if (up.framework.booting) {
12977
13031
  macro.priority = detectSystemMacroPriority(macro.selector) || up.fail('Unregistered priority for system macro %o', macro.selector);
12978
13032
  }
12979
13033
  return insertCompiler(macros, macro);
@@ -13037,7 +13091,7 @@ or when a matching fragment is [inserted via AJAX](/up.link) later.
13037
13091
  ref = parseCompilerArgs(args), selector = ref[0], options = ref[1], callback = ref[2];
13038
13092
  options = u.options(options, {
13039
13093
  selector: selector,
13040
- isDefault: up.framework.isBooting(),
13094
+ isDefault: up.framework.booting,
13041
13095
  priority: 0,
13042
13096
  batch: false,
13043
13097
  keep: false,
@@ -13304,7 +13358,11 @@ In an Unpoly app, every page has an URL.
13304
13358
  };
13305
13359
 
13306
13360
  /***
13307
- Returns a normalized URL for the current history entry.
13361
+ Returns a normalized URL for the current browser location.
13362
+
13363
+ Note that if the current [layer](/up.layer) does not have [visible history](/up.Layer.prototype.historyVisible),
13364
+ the browser's address bar will show the location of an ancestor layer.
13365
+ To get the location of the current layer, use `up.layer.location`.
13308
13366
 
13309
13367
  @property up.history.location
13310
13368
  @param {string} location
@@ -13397,9 +13455,15 @@ In an Unpoly app, every page has an URL.
13397
13455
  /***
13398
13456
  This event is [emitted](/up.emit) after the browser's address bar was updated with a new URL.
13399
13457
 
13400
- Reasons for a changed location are e.g. [fragment navigation](/navigation) or the user pressing the back button.
13458
+ There may be several reasons why the browser location was changed:
13401
13459
 
13402
- Also see `up:layer:location:changed`.
13460
+ - A fragment update changes history through [navigation](/navigation) or rendering with `{ history: true }`.
13461
+ - The user uses the back or forward buttons in their browser UI.
13462
+ - Programmatic calls to `up.history.push()`.
13463
+
13464
+ When a [layer](/up.layer) has no [visible history](/up.Layer.prototype.historyVisible), following a link
13465
+ will not cause the browser's address bar to be updated. In this case no `up:location:changed` event will be emitted.
13466
+ There will however be an `up:layer:location:changed` event be emitted.
13403
13467
 
13404
13468
  @event up:location:changed
13405
13469
  @param {string} event.url
@@ -13487,7 +13551,7 @@ In an Unpoly app, every page has an URL.
13487
13551
  Changes the link's destination so it points to the previous URL.
13488
13552
 
13489
13553
  Note that this will *not* call `location.back()`, but will set
13490
- the link's `up-href` attribute to the actual, previous URL.
13554
+ the link's `[up-href]` attribute to the actual, previous URL.
13491
13555
 
13492
13556
  If no previous URL is known, the link will not be changed.
13493
13557
 
@@ -13495,15 +13559,19 @@ In an Unpoly app, every page has an URL.
13495
13559
 
13496
13560
  This link ...
13497
13561
 
13498
- <a href="/default" up-back>
13499
- Go back
13500
- </a>
13562
+ ```html
13563
+ <a href="/default" up-back>
13564
+ Go back
13565
+ </a>
13566
+ ```
13501
13567
 
13502
13568
  ... will be transformed to:
13503
13569
 
13504
- <a href="/default" up-href="/previous-page" up-restore-scroll up-follow>
13505
- Go back
13506
- </a>
13570
+ ```html
13571
+ <a href="/default" up-href="/previous-page" up-scroll="restore" up-follow>
13572
+ Go back
13573
+ </a>
13574
+ ```
13507
13575
 
13508
13576
  @selector a[up-back]
13509
13577
  @stable
@@ -13512,7 +13580,7 @@ In an Unpoly app, every page has an URL.
13512
13580
  if (previousLocation) {
13513
13581
  e.setMissingAttrs(link, {
13514
13582
  'up-href': previousLocation,
13515
- 'up-restore-scroll': ''
13583
+ 'up-scroll': 'restore'
13516
13584
  });
13517
13585
  link.removeAttribute('up-back');
13518
13586
  return up.link.makeFollowable(link);
@@ -13689,7 +13757,7 @@ is built from `up.fragment` functions. You may use them to extend Unpoly from yo
13689
13757
  @param {Element|string} element
13690
13758
  The element or CSS selector for which to look up the source URL.
13691
13759
  @return {string|undefined}
13692
- @experimental
13760
+ @stable
13693
13761
  */
13694
13762
  sourceOf = function(element, options) {
13695
13763
  if (options == null) {
@@ -13700,7 +13768,7 @@ is built from `up.fragment` functions. You may use them to extend Unpoly from yo
13700
13768
  };
13701
13769
 
13702
13770
  /***
13703
- Returns a timestamp for the the given element was retrieved from.
13771
+ Returns a timestamp for the last modification of the content in the given element.
13704
13772
 
13705
13773
  @function up.fragment.time
13706
13774
  @param {Element} element
@@ -14139,6 +14207,7 @@ is built from `up.fragment` functions. You may use them to extend Unpoly from yo
14139
14207
  Instead of preventing the update, listeners may also access the `event.renderOptions` object
14140
14208
  to mutate options to the `up.render()` call that will process the server response.
14141
14209
 
14210
+ @event up:fragment:loaded
14142
14211
  @param event.preventDefault()
14143
14212
  Event listeners may call this method to prevent the fragment change.
14144
14213
  @param {up.Request} event.request
@@ -14147,22 +14216,27 @@ is built from `up.fragment` functions. You may use them to extend Unpoly from yo
14147
14216
  The server response.
14148
14217
  @param {Object} event.renderOptions
14149
14218
  Options for the `up.render()` call that will process the server response.
14150
- @event up:fragment:loaded
14151
14219
  */
14152
14220
 
14153
14221
  /***
14154
14222
  Elements with an `up-keep` attribute will be persisted during
14155
14223
  [fragment updates](/up.fragment).
14156
14224
 
14157
- For example:
14158
-
14159
- <audio up-keep src="song.mp3"></audio>
14160
-
14161
- The element you're keeping should have an umambiguous class name, ID or `up-id`
14225
+ The element you're keeping should have an umambiguous class name, ID or `[up-id]`
14162
14226
  attribute so Unpoly can find its new position within the page update.
14163
14227
 
14164
14228
  Emits events [`up:fragment:keep`](/up:fragment:keep) and [`up:fragment:kept`](/up:fragment:kept).
14165
14229
 
14230
+ \#\#\# Example
14231
+
14232
+ The following `<audio>` element will be persisted through fragment
14233
+ updates as long as the responses contain an element matching `#player`:
14234
+
14235
+
14236
+ ```html
14237
+ <audio id="player" up-keep src="song.mp3"></audio>
14238
+ ```
14239
+
14166
14240
  \#\#\# Controlling if an element will be kept
14167
14241
 
14168
14242
  Unpoly will **only** keep an existing element if:
@@ -14254,9 +14328,11 @@ is built from `up.fragment` functions. You may use them to extend Unpoly from yo
14254
14328
  the `innerHTML` property or calling jQuery methods like
14255
14329
  `html`, `insertAfter` or `appendTo`:
14256
14330
 
14257
- element = document.createElement('div')
14258
- element.innerHTML = '... HTML that needs to be activated ...'
14259
- up.hello(element)
14331
+ ```html
14332
+ element = document.createElement('div')
14333
+ element.innerHTML = '... HTML that needs to be activated ...'
14334
+ up.hello(element)
14335
+ ```
14260
14336
 
14261
14337
  This function emits the [`up:fragment:inserted`](/up:fragment:inserted)
14262
14338
  event.
@@ -14758,6 +14834,10 @@ is built from `up.fragment` functions. You may use them to extend Unpoly from yo
14758
14834
  To reload from another URL, pass a `{ url }` option or set an `[up-source]` attribute
14759
14835
  on the element or its ancestors.
14760
14836
 
14837
+ \#\#\# Skipping updates when nothing changed
14838
+
14839
+ TODO: Document [up-time] and X-Up-Reload-From-Time (currently both documented in `X-Up-Reload-From-Time`).
14840
+
14761
14841
  @function up.reload
14762
14842
  @param {string|Element|jQuery} [target]
14763
14843
  The element that should be reloaded.
@@ -15084,6 +15164,11 @@ is built from `up.fragment` functions. You may use them to extend Unpoly from yo
15084
15164
  */
15085
15165
 
15086
15166
  /***
15167
+ Returns whether the given element matches the given CSS selector.
15168
+
15169
+ Other than `up.element.matches()` this function supports non-standard selectors
15170
+ like `:main` or `:layer`.
15171
+
15087
15172
  @function up.fragment.matches
15088
15173
  @param {Element} fragment
15089
15174
  @param {string|Array<string>} selectorOrSelectors
@@ -15095,6 +15180,7 @@ is built from `up.fragment` functions. You may use them to extend Unpoly from yo
15095
15180
  @param {string|up.Layer} options.mode
15096
15181
  Required if `{ layer: 'new' }` is passed.
15097
15182
  @return {boolean}
15183
+ @experimental
15098
15184
  */
15099
15185
  matches = function(element, selector, options) {
15100
15186
  if (options == null) {
@@ -16123,13 +16209,11 @@ You can define custom animations using `up.transition()` and
16123
16209
 
16124
16210
  (function() {
16125
16211
  up.motion = (function() {
16126
- var animCount, animate, animateNow, applyConfig, composeTransitionFn, config, defaultNamedAnimations, defaultNamedTransitions, e, findAnimationFn, findNamedAnimation, findTransitionFn, finish, isEnabled, isNone, morph, motionController, namedAnimations, namedTransitions, onBoot, registerAnimation, registerMoveMotions, registerOpacityAnimation, registerTransition, reset, skipAnimate, swapElementsDirectly, translateCSS, u, untranslatedBox, willAnimate;
16212
+ var animCount, animate, animateNow, applyConfig, composeTransitionFn, config, e, findAnimationFn, findNamedAnimation, findTransitionFn, finish, isEnabled, isNone, morph, motionController, namedAnimations, namedTransitions, pickDefault, registerAnimation, registerMoveMotions, registerOpacityAnimation, registerTransition, reset, skipAnimate, swapElementsDirectly, translateCSS, u, untranslatedBox, warnIfDisabled, willAnimate;
16127
16213
  u = up.util;
16128
16214
  e = up.element;
16129
16215
  namedAnimations = {};
16130
- defaultNamedAnimations = {};
16131
16216
  namedTransitions = {};
16132
- defaultNamedTransitions = {};
16133
16217
  motionController = new up.MotionController('motion');
16134
16218
 
16135
16219
  /***
@@ -16157,10 +16241,15 @@ You can define custom animations using `up.transition()` and
16157
16241
  enabled: !matchMedia('(prefers-reduced-motion: reduce)').matches
16158
16242
  };
16159
16243
  });
16244
+ pickDefault = function(registry) {
16245
+ return u.pickBy(registry, function(value) {
16246
+ return value.isDefault;
16247
+ });
16248
+ };
16160
16249
  reset = function() {
16161
16250
  motionController.reset();
16162
- namedAnimations = u.copy(defaultNamedAnimations);
16163
- namedTransitions = u.copy(defaultNamedTransitions);
16251
+ namedAnimations = pickDefault(namedAnimations);
16252
+ namedTransitions = pickDefault(namedTransitions);
16164
16253
  return config.reset();
16165
16254
  };
16166
16255
 
@@ -16557,7 +16646,10 @@ You can define custom animations using `up.transition()` and
16557
16646
  @stable
16558
16647
  */
16559
16648
  registerTransition = function(name, transition) {
16560
- return namedTransitions[name] = findTransitionFn(transition);
16649
+ var fn;
16650
+ fn = findTransitionFn(transition);
16651
+ fn.isDefault = up.framework.booting;
16652
+ return namedTransitions[name] = fn;
16561
16653
  };
16562
16654
 
16563
16655
  /***
@@ -16593,11 +16685,12 @@ You can define custom animations using `up.transition()` and
16593
16685
  @stable
16594
16686
  */
16595
16687
  registerAnimation = function(name, animation) {
16596
- return namedAnimations[name] = findAnimationFn(animation);
16688
+ var fn;
16689
+ fn = findAnimationFn(animation);
16690
+ fn.isDefault = up.framework.booting;
16691
+ return namedAnimations[name] = fn;
16597
16692
  };
16598
- onBoot = function() {
16599
- defaultNamedAnimations = u.copy(namedAnimations);
16600
- defaultNamedTransitions = u.copy(namedTransitions);
16693
+ warnIfDisabled = function() {
16601
16694
  if (!isEnabled()) {
16602
16695
  return up.puts('up.motion', 'Animations are disabled');
16603
16696
  }
@@ -16722,7 +16815,7 @@ You can define custom animations using `up.transition()` and
16722
16815
 
16723
16816
  @see server-errors
16724
16817
  */
16725
- up.on('up:framework:boot', onBoot);
16818
+ up.on('up:framework:boot', warnIfDisabled);
16726
16819
  up.on('up:framework:reset', reset);
16727
16820
  return {
16728
16821
  morph: morph,
@@ -16840,11 +16933,6 @@ You can define custom animations using `up.transition()` and
16840
16933
 
16841
16934
  Defaults to 5 minutes.
16842
16935
 
16843
- @param {number} [config.badResponseTime=300]
16844
- How long the proxy waits until emitting the [`up:request:late` event](/up:request:late).
16845
-
16846
- The value is given in milliseconds.
16847
-
16848
16936
  @param {number} [config.badDownlink=0.6]
16849
16937
  The connection's minimum effective bandwidth estimate required
16850
16938
  to prevent Unpoly from [reducing requests](/up.network.shouldReduceRequests).
@@ -16857,8 +16945,8 @@ You can define custom animations using `up.transition()` and
16857
16945
 
16858
16946
  The value is given in milliseconds. Lower is better.
16859
16947
 
16860
- @param {number} [config.badResponseTime=800]
16861
- The time to wait for a response before `up:request:late` is emitted.
16948
+ @param {number} [config.badResponseTime=400]
16949
+ How long the proxy waits until emitting the [`up:request:late` event](/up:request:late).
16862
16950
 
16863
16951
  This metric is *not* considered for the decision to
16864
16952
  [reduce requests](/up.network.shouldReduceRequests).
@@ -16932,7 +17020,7 @@ You can define custom animations using `up.transition()` and
16932
17020
  cacheExpiry: 1000 * 60 * 5,
16933
17021
  badDownlink: 0.6,
16934
17022
  badRTT: 750,
16935
- badResponseTime: 800,
17023
+ badResponseTime: 400,
16936
17024
  autoCache: function(request) {
16937
17025
  return request.isSafe();
16938
17026
  },
@@ -17802,10 +17890,13 @@ You can define custom animations using `up.transition()` and
17802
17890
  }));
17803
17891
  };
17804
17892
  build = function(options) {
17805
- var Class, configs, mode;
17893
+ var Class, configs, handleDeprecatedConfig, mode;
17806
17894
  mode = options.mode;
17807
17895
  Class = config[mode].Class;
17808
17896
  configs = u.reverse(modeConfigs(mode));
17897
+ if (handleDeprecatedConfig = up.migrate.handleLayerConfig) {
17898
+ configs.forEach(handleDeprecatedConfig);
17899
+ }
17809
17900
  options = u.mergeDefined.apply(u, slice.call(configs).concat([{
17810
17901
  mode: mode,
17811
17902
  stack: stack
@@ -18001,10 +18092,10 @@ You can define custom animations using `up.transition()` and
18001
18092
  */
18002
18093
 
18003
18094
  /***
18004
- This event is emitted after a layer's [location property](/up.Layer#location)
18095
+ This event is emitted after a layer's [location property](/up.Layer.prototype.location)
18005
18096
  has changed value.
18006
18097
 
18007
- This event is also emitted when a layer [without history](/up.Layer#history)
18098
+ This event is also emitted when a layer [without history](/up.Layer.prototype.historyVisible)
18008
18099
  has reached a new location.
18009
18100
 
18010
18101
  @param {string} event.location
@@ -18534,6 +18625,17 @@ You can define custom animations using `up.transition()` and
18534
18625
 
18535
18626
  @property up.layer.historyVisible
18536
18627
  @param {boolean} historyVisible
18628
+ @stable
18629
+ */
18630
+
18631
+ /***
18632
+ The location of the [current layer](/up.layer.current).
18633
+
18634
+ This is a shortcut for `up.layer.current.location`.
18635
+ See `up.Layer#location` for more documentation.
18636
+
18637
+ @property up.layer.location
18638
+ @param {string} location
18537
18639
  @stable
18538
18640
  */
18539
18641
  u.delegate(api, ['accept', 'dismiss', 'isRoot', 'isOverlay', 'isFront', 'on', 'off', 'emit', 'parent', 'historyVisible', 'location', 'mode', 'context', 'element', 'contains', 'size', 'affix'], function() {
@@ -19184,14 +19286,18 @@ new page is loading.
19184
19286
 
19185
19287
  Assume we have two links, one of which is `[up-instant]`:
19186
19288
 
19187
- <a href="/one">Link 1</a>
19188
- <a href="/two" up-instant>Link 2</a>
19289
+ ```html
19290
+ <a href="/one">Link 1</a>
19291
+ <a href="/two" up-instant>Link 2</a>
19292
+ ```
19189
19293
 
19190
19294
  The following event listener will be called when *either* link is activated:
19191
19295
 
19192
- document.addEventListener('up:click', function(event) {
19193
- ...
19194
- })
19296
+ ```js
19297
+ document.addEventListener('up:click', function(event) {
19298
+ ...
19299
+ })
19300
+ ```
19195
19301
 
19196
19302
  \#\#\# Cancelation is forwarded
19197
19303
 
@@ -20814,19 +20920,22 @@ Once the response is received the URL will change to `/bar` and the `up-active`
20814
20920
  e = up.element;
20815
20921
 
20816
20922
  /***
20817
- Sets default options for this module.
20923
+ Sets default options for this package.
20818
20924
 
20819
20925
  @property up.feedback.config
20926
+
20820
20927
  @param {Array<string>} [config.currentClasses]
20821
20928
  An array of classes to set on [links that point the current location](/a.up-current).
20929
+
20822
20930
  @param {Array<string>} [config.navSelectors]
20823
20931
  An array of CSS selectors that match [navigation components](/up-nav).
20932
+
20824
20933
  @stable
20825
20934
  */
20826
20935
  config = new up.Config(function() {
20827
20936
  return {
20828
20937
  currentClasses: ['up-current'],
20829
- navSelectors: ['[up-nav]']
20938
+ navSelectors: ['[up-nav]', 'nav']
20830
20939
  };
20831
20940
  });
20832
20941
  reset = function() {
@@ -20927,28 +21036,34 @@ Once the response is received the URL will change to `/bar` and the `up-active`
20927
21036
 
20928
21037
  /***
20929
21038
  Links that are currently [loading through Unpoly](/a-up-follow)
20930
- are assigned the `up-active` class automatically.
21039
+ are assigned the `.up-active` class automatically.
20931
21040
 
20932
21041
  Style `.up-active` in your CSS to improve the perceived responsiveness
20933
21042
  of your user interface.
20934
21043
 
20935
- The `up-active` class will be removed when the link is done loading.
21044
+ The `.up-active` class will be removed when the link is done loading.
20936
21045
 
20937
21046
  \#\#\# Example
20938
21047
 
20939
21048
  We have a link:
20940
21049
 
20941
- <a href="/foo" up-follow>Foo</a>
21050
+ ```html
21051
+ <a href="/foo" up-follow>Foo</a>
21052
+ ```
20942
21053
 
20943
21054
  The user clicks on the link. While the request is loading,
20944
21055
  the link has the `up-active` class:
20945
21056
 
20946
- <a href="/foo" up-follow class="up-active">Foo</a>
21057
+ ```html
21058
+ <a href="/foo" up-follow class="up-active">Foo</a>
21059
+ ```
20947
21060
 
20948
- Once the link destination has loaded and rendered, the `up-active` class
20949
- is removed and the [`up-current`](/a.up-current) class is added:
21061
+ Once the link destination has loaded and rendered, the `.up-active` class
21062
+ is removed and the [`.up-current`](/a.up-current) class is added:
20950
21063
 
20951
- <a href="/foo" up-follow class="up-current">Foo</a>
21064
+ ```html
21065
+ <a href="/foo" up-follow class="up-current">Foo</a>
21066
+ ```
20952
21067
 
20953
21068
  @selector a.up-active
20954
21069
  @stable
@@ -20956,29 +21071,33 @@ Once the response is received the URL will change to `/bar` and the `up-active`
20956
21071
 
20957
21072
  /***
20958
21073
  Forms that are currently [loading through Unpoly](/form-up-submit)
20959
- are assigned the `up-active` class automatically.
21074
+ are assigned the `.up-active` class automatically.
20960
21075
  Style `.up-active` in your CSS to improve the perceived responsiveness
20961
21076
  of your user interface.
20962
21077
 
20963
- The `up-active` class will be removed as soon as the response to the
21078
+ The `.up-active` class will be removed as soon as the response to the
20964
21079
  form submission has been received.
20965
21080
 
20966
21081
  \#\#\# Example
20967
21082
 
20968
21083
  We have a form:
20969
21084
 
20970
- <form up-target=".foo">
20971
- <button type="submit">Submit</button>
20972
- </form>
21085
+ ```html
21086
+ <form up-target=".foo">
21087
+ <button type="submit">Submit</button>
21088
+ </form>
21089
+ ```
20973
21090
 
20974
21091
  The user clicks on the submit button. While the form is being submitted
20975
21092
  and waiting for the server to respond, the form has the `up-active` class:
20976
21093
 
20977
- <form up-target=".foo" class="up-active">
20978
- <button type="submit">Submit</button>
20979
- </form>
21094
+ ```html
21095
+ <form up-target=".foo" class="up-active">
21096
+ <button type="submit">Submit</button>
21097
+ </form>
21098
+ ```
20980
21099
 
20981
- Once the link destination has loaded and rendered, the `up-active` class
21100
+ Once the link destination has loaded and rendered, the `.up-active` class
20982
21101
  is removed.
20983
21102
 
20984
21103
  @selector form.up-active
@@ -20986,7 +21105,7 @@ Once the response is received the URL will change to `/bar` and the `up-active`
20986
21105
  */
20987
21106
 
20988
21107
  /***
20989
- Marks the given element as no longer loading, by removing the CSS class [`up-active`](/a.up-active).
21108
+ Marks the given element as no longer loading, by removing the CSS class [`.up-active`](/a.up-active).
20990
21109
 
20991
21110
  This happens automatically when network requests initiated by the Unpoly API have completed.
20992
21111
  Use this function if you make custom network calls from your own JavaScript code.
@@ -21028,46 +21147,51 @@ Once the response is received the URL will change to `/bar` and the `up-active`
21028
21147
  /***
21029
21148
  Marks this element as a navigation component, such as a menu or navigation bar.
21030
21149
 
21031
- When a link within an `[up-nav]` element points to the current location, it is assigned the [`.up-current`](/a.up-current) class. When the browser navigates to another location, the class is removed automatically.
21150
+ When a link within an `[up-nav]` element points to [its layer's location](/up.layer.location),
21151
+ it is assigned the [`.up-current`](/a.up-current) class. When the browser navigates to another location, the class is removed automatically.
21032
21152
 
21033
21153
  You may also assign `[up-nav]` to an individual link instead of an navigational container.
21034
21154
 
21035
- If you don't want to manually add this attribute to every navigational element, you can configure selectors to automatically match your navigation components in `up.feedback.config.navs`.
21155
+ If you don't want to manually add this attribute to every navigational element,
21156
+ you can configure selectors to automatically match your navigation components in `up.feedback.config.navs`.
21036
21157
 
21037
21158
 
21038
21159
  \#\#\# Example
21039
21160
 
21040
21161
  Let's take a simple menu with two links. The menu has been marked with the `[up-nav]` attribute:
21041
21162
 
21042
- <div up-nav>
21043
- <a href="/foo">Foo</a>
21044
- <a href="/bar">Bar</a>
21045
- </div>
21163
+ ```html
21164
+ <div up-nav>
21165
+ <a href="/foo">Foo</a>
21166
+ <a href="/bar">Bar</a>
21167
+ </div>
21168
+ ```
21046
21169
 
21047
21170
  If the browser location changes to `/foo`, the first link is marked as `.up-current`:
21048
21171
 
21049
- <div up-nav>
21050
- <a href="/foo" class="up-current">Foo</a>
21051
- <a href="/bar">Bar</a>
21052
- </div>
21172
+ ```html
21173
+ <div up-nav>
21174
+ <a href="/foo" class="up-current">Foo</a>
21175
+ <a href="/bar">Bar</a>
21176
+ </div>
21177
+ ```
21053
21178
 
21054
21179
  If the browser location changes to `/bar`, the first link automatically loses its `.up-current` class. Now the second link is marked as `.up-current`:
21055
21180
 
21056
- <div up-nav>
21057
- <a href="/foo">Foo</a>
21058
- <a href="/bar" class="up-current">Bar</a>
21059
- </div>
21060
-
21181
+ ```html
21182
+ <div up-nav>
21183
+ <a href="/foo">Foo</a>
21184
+ <a href="/bar" class="up-current">Bar</a>
21185
+ </div>
21186
+ ```
21061
21187
 
21062
- \#\#\# What is considered to be "current"?
21063
21188
 
21064
- The current location is considered to be either:
21189
+ \#\#\# When is a link "current"?
21065
21190
 
21066
- - the URL displayed in the browser window's location bar
21067
- - the source URL of a [modal dialog](/up.modal)
21068
- - the URL of the page behind a [modal dialog](/up.modal)
21069
- - the source URL of a [popup overlay](/up.popup)
21070
- - the URL of the content behind a [popup overlay](/up.popup)
21191
+ When no [overlay](/up.layer) is open, the current location is the URL displayed
21192
+ in the browser's address bar. When the link in question is placed in an overlay,
21193
+ the current location is the location of that overlay, even if that
21194
+ overlay doesn't have [visible history](/up.Layer.prototype.historyVisible).
21071
21195
 
21072
21196
  A link matches the current location (and is marked as `.up-current`) if it matches either:
21073
21197
 
@@ -21080,41 +21204,24 @@ Once the response is received the URL will change to `/bar` and the `up-active`
21080
21204
  */
21081
21205
 
21082
21206
  /***
21083
- Links within `[up-nav]` may use the `[up-alias]` attribute to pass an URL pattern for which they
21207
+ Links within `[up-nav]` may use the `[up-alias]` attribute to pass an [URL pattern](/url-patterns) for which they
21084
21208
  should also be highlighted as [`.up-current`](a.up-current).
21085
21209
 
21086
- \#\#\# Examples
21210
+ \#\#\# Example
21087
21211
 
21088
21212
  The link below will be highlighted with `.up-current` at both `/profile` and `/profile/edit` locations:
21089
21213
 
21090
- <nav up-nav>
21091
- <a href="/profile" up-alias="/profile/edit">Profile</a>
21092
- </nav>
21093
-
21094
- To pass more than one alternative URLs, separate them by a space character:
21095
-
21096
- <nav up-nav>
21097
- <a href="/profile" up-alias="/profile/new /profile/edit">Profile</a>
21098
- </nav>
21099
-
21100
- Often you would like to mark a link as `.up-current` whenever the current URL matches a prefix or suffix.
21101
- To do so, include an asterisk (`*`) in the `[up-alias]` attribute. For instance, the first link in the
21102
- below will be highlighted for both `/users` and `/users/123`:
21103
-
21104
- <nav up-nav>
21105
- <a href="/users" up-alias="/users/*">Users</a>
21106
- <a href="/reports" up-alias="/reports/*">Reports</a>
21107
- </div>
21108
-
21109
- You may pass multiple patterns separated by a space character:
21214
+ ```html
21215
+ <div up-nav>
21216
+ <a href="/profile" up-alias="/profile/edit">Profile</a>
21217
+ </div>
21218
+ ```
21110
21219
 
21111
- <nav up-nav>
21112
- <a href="/users" up-alias="/users/* /profile/*">Users</a>
21113
- </nav>
21220
+ To pass more than one alternative URLs, use an [URL pattern](/url-patterns).
21114
21221
 
21115
21222
  @selector a[up-alias]
21116
21223
  @param up-alias
21117
- A space-separated list of alternative URLs or URL patterns.
21224
+ A [URL pattern](/url-patterns) with alternative URLs.
21118
21225
  @stable
21119
21226
  */
21120
21227
 
@@ -21349,6 +21456,10 @@ passively receive updates from the server.
21349
21456
  2 new messages
21350
21457
  </div>
21351
21458
 
21459
+ \#\#\# Skipping updates when nothing changed
21460
+
21461
+ TODO: Document [up-time] and X-Up-Reload-From-Time (currently both documented in `X-Up-Reload-From-Time`).
21462
+
21352
21463
  @selector [up-poll]
21353
21464
  @param [up-interval]
21354
21465
  The reload interval in milliseconds.