tao_on_rails 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: de9e1c635c69c821689bd1fa77d5a10c09488d7b
4
- data.tar.gz: 87d215ee8c1b4ddfddae9dbd945e65fa45d4a303
3
+ metadata.gz: 18cf70d94e5c971dd3bcf9b0525b324767d55ca7
4
+ data.tar.gz: 5ef69465b21078177c69d852bcf0048fdaf8bf3e
5
5
  SHA512:
6
- metadata.gz: a35b1d83c05900ea8b717d87a0cad18cfb2f4e3278a48d04d3fdabf6758b92d79751bc36fa3eadd0b61e46c990bb4cc5d97db68db817c7c87b4fabb8f4f6feeb
7
- data.tar.gz: 1dec9b9db604fad8bbf1838acfbb0de072c8a5e2618c31ad8d1e5d1fffd3cebbc07ca76b745c1513a9336e9e74b3db6000f16f0a524945858e11f947972d4d6a
6
+ metadata.gz: 16683209053ac132c3d22382a82a511aa63c43193e00631206259ee5b8ce7e4744d8e40f2798fa072c960490c77d2715bd813e10d7e6bdd9b660e22c4d7dd926
7
+ data.tar.gz: 1139cd527ef3638a08fe967ac1a67799d99aa21d945d7b40b6600214d5720e325fe0888a9950991b0d8f18e5b83a0a2059fc8e60f156715c25287ac0f2ec2e52
data/dist/tao.js CHANGED
@@ -5,9 +5,8 @@ Copyright © 2016 Basecamp, LLC
5
5
 
6
6
  (function(){(function(){(function(){this.Turbolinks={supported:function(){return null!=window.history.pushState&&null!=window.requestAnimationFrame}(),visit:function(e,r){return t.controller.visit(e,r)},clearCache:function(){return t.controller.clearCache()}}}).call(this)}).call(this);var t=this.Turbolinks;(function(){(function(){var e,r;t.copyObject=function(t){var e,r,n;r={};for(e in t)n=t[e],r[e]=n;return r},t.closest=function(t,r){return e.call(t,r)},e=function(){var t,e;return t=document.documentElement,null!=(e=t.closest)?e:function(t){var e;for(e=this;e;){if(e.nodeType===Node.ELEMENT_NODE&&r.call(e,t))return e;e=e.parentNode}}}(),t.defer=function(t){return setTimeout(t,1)},t.dispatch=function(t,e){var r,n,o,i,s;return i=null!=e?e:{},s=i.target,r=i.cancelable,n=i.data,o=document.createEvent("Events"),o.initEvent(t,!0,r===!0),o.data=null!=n?n:{},(null!=s?s:document).dispatchEvent(o),o},t.match=function(t,e){return r.call(t,e)},r=function(){var t,e,r,n;return t=document.documentElement,null!=(e=null!=(r=null!=(n=t.matchesSelector)?n:t.webkitMatchesSelector)?r:t.msMatchesSelector)?e:t.mozMatchesSelector}(),t.uuid=function(){var t,e,r;for(r="",t=e=1;36>=e;t=++e)r+=9===t||14===t||19===t||24===t?"-":15===t?"4":20===t?(Math.floor(4*Math.random())+8).toString(16):Math.floor(15*Math.random()).toString(16);return r}}).call(this),function(){t.Location=function(){function t(t){var e,r;null==t&&(t=""),r=document.createElement("a"),r.href=t.toString(),this.absoluteURL=r.href,e=r.hash.length,2>e?this.requestURL=this.absoluteURL:(this.requestURL=this.absoluteURL.slice(0,-e),this.anchor=r.hash.slice(1))}var e,r,n,o;return t.wrap=function(t){return t instanceof this?t:new this(t)},t.prototype.getOrigin=function(){return this.absoluteURL.split("/",3).join("/")},t.prototype.getPath=function(){var t,e;return null!=(t=null!=(e=this.absoluteURL.match(/\/\/[^\/]*(\/[^?;]*)/))?e[1]:void 0)?t:"/"},t.prototype.getPathComponents=function(){return this.getPath().split("/").slice(1)},t.prototype.getLastPathComponent=function(){return this.getPathComponents().slice(-1)[0]},t.prototype.getExtension=function(){var t,e;return null!=(t=null!=(e=this.getLastPathComponent().match(/\.[^.]*$/))?e[0]:void 0)?t:""},t.prototype.isHTML=function(){return this.getExtension().match(/^(?:|\.(?:htm|html|xhtml))$/)},t.prototype.isPrefixedBy=function(t){var e;return e=r(t),this.isEqualTo(t)||o(this.absoluteURL,e)},t.prototype.isEqualTo=function(t){return this.absoluteURL===(null!=t?t.absoluteURL:void 0)},t.prototype.toCacheKey=function(){return this.requestURL},t.prototype.toJSON=function(){return this.absoluteURL},t.prototype.toString=function(){return this.absoluteURL},t.prototype.valueOf=function(){return this.absoluteURL},r=function(t){return e(t.getOrigin()+t.getPath())},e=function(t){return n(t,"/")?t:t+"/"},o=function(t,e){return t.slice(0,e.length)===e},n=function(t,e){return t.slice(-e.length)===e},t}()}.call(this),function(){var e=function(t,e){return function(){return t.apply(e,arguments)}};t.HttpRequest=function(){function r(r,n,o){this.delegate=r,this.requestCanceled=e(this.requestCanceled,this),this.requestTimedOut=e(this.requestTimedOut,this),this.requestFailed=e(this.requestFailed,this),this.requestLoaded=e(this.requestLoaded,this),this.requestProgressed=e(this.requestProgressed,this),this.url=t.Location.wrap(n).requestURL,this.referrer=t.Location.wrap(o).absoluteURL,this.createXHR()}return r.NETWORK_FAILURE=0,r.TIMEOUT_FAILURE=-1,r.timeout=60,r.prototype.send=function(){var t;return this.xhr&&!this.sent?(this.notifyApplicationBeforeRequestStart(),this.setProgress(0),this.xhr.send(),this.sent=!0,"function"==typeof(t=this.delegate).requestStarted?t.requestStarted():void 0):void 0},r.prototype.cancel=function(){return this.xhr&&this.sent?this.xhr.abort():void 0},r.prototype.requestProgressed=function(t){return t.lengthComputable?this.setProgress(t.loaded/t.total):void 0},r.prototype.requestLoaded=function(){return this.endRequest(function(t){return function(){var e;return 200<=(e=t.xhr.status)&&300>e?t.delegate.requestCompletedWithResponse(t.xhr.responseText,t.xhr.getResponseHeader("Turbolinks-Location")):(t.failed=!0,t.delegate.requestFailedWithStatusCode(t.xhr.status,t.xhr.responseText))}}(this))},r.prototype.requestFailed=function(){return this.endRequest(function(t){return function(){return t.failed=!0,t.delegate.requestFailedWithStatusCode(t.constructor.NETWORK_FAILURE)}}(this))},r.prototype.requestTimedOut=function(){return this.endRequest(function(t){return function(){return t.failed=!0,t.delegate.requestFailedWithStatusCode(t.constructor.TIMEOUT_FAILURE)}}(this))},r.prototype.requestCanceled=function(){return this.endRequest()},r.prototype.notifyApplicationBeforeRequestStart=function(){return t.dispatch("turbolinks:request-start",{data:{url:this.url,xhr:this.xhr}})},r.prototype.notifyApplicationAfterRequestEnd=function(){return t.dispatch("turbolinks:request-end",{data:{url:this.url,xhr:this.xhr}})},r.prototype.createXHR=function(){return this.xhr=new XMLHttpRequest,this.xhr.open("GET",this.url,!0),this.xhr.timeout=1e3*this.constructor.timeout,this.xhr.setRequestHeader("Accept","text/html, application/xhtml+xml"),this.xhr.setRequestHeader("Turbolinks-Referrer",this.referrer),this.xhr.onprogress=this.requestProgressed,this.xhr.onload=this.requestLoaded,this.xhr.onerror=this.requestFailed,this.xhr.ontimeout=this.requestTimedOut,this.xhr.onabort=this.requestCanceled},r.prototype.endRequest=function(t){return this.xhr?(this.notifyApplicationAfterRequestEnd(),null!=t&&t.call(this),this.destroy()):void 0},r.prototype.setProgress=function(t){var e;return this.progress=t,"function"==typeof(e=this.delegate).requestProgressed?e.requestProgressed(this.progress):void 0},r.prototype.destroy=function(){var t;return this.setProgress(1),"function"==typeof(t=this.delegate).requestFinished&&t.requestFinished(),this.delegate=null,this.xhr=null},r}()}.call(this),function(){var e=function(t,e){return function(){return t.apply(e,arguments)}};t.ProgressBar=function(){function t(){this.trickle=e(this.trickle,this),this.stylesheetElement=this.createStylesheetElement(),this.progressElement=this.createProgressElement()}var r;return r=300,t.defaultCSS=".turbolinks-progress-bar {\n position: fixed;\n display: block;\n top: 0;\n left: 0;\n height: 3px;\n background: #0076ff;\n z-index: 9999;\n transition: width "+r+"ms ease-out, opacity "+r/2+"ms "+r/2+"ms ease-in;\n transform: translate3d(0, 0, 0);\n}",t.prototype.show=function(){return this.visible?void 0:(this.visible=!0,this.installStylesheetElement(),this.installProgressElement(),this.startTrickling())},t.prototype.hide=function(){return this.visible&&!this.hiding?(this.hiding=!0,this.fadeProgressElement(function(t){return function(){return t.uninstallProgressElement(),t.stopTrickling(),t.visible=!1,t.hiding=!1}}(this))):void 0},t.prototype.setValue=function(t){return this.value=t,this.refresh()},t.prototype.installStylesheetElement=function(){return document.head.insertBefore(this.stylesheetElement,document.head.firstChild)},t.prototype.installProgressElement=function(){return this.progressElement.style.width=0,this.progressElement.style.opacity=1,document.documentElement.insertBefore(this.progressElement,document.body),this.refresh()},t.prototype.fadeProgressElement=function(t){return this.progressElement.style.opacity=0,setTimeout(t,1.5*r)},t.prototype.uninstallProgressElement=function(){return this.progressElement.parentNode?document.documentElement.removeChild(this.progressElement):void 0},t.prototype.startTrickling=function(){return null!=this.trickleInterval?this.trickleInterval:this.trickleInterval=setInterval(this.trickle,r)},t.prototype.stopTrickling=function(){return clearInterval(this.trickleInterval),this.trickleInterval=null},t.prototype.trickle=function(){return this.setValue(this.value+Math.random()/100)},t.prototype.refresh=function(){return requestAnimationFrame(function(t){return function(){return t.progressElement.style.width=10+90*t.value+"%"}}(this))},t.prototype.createStylesheetElement=function(){var t;return t=document.createElement("style"),t.type="text/css",t.textContent=this.constructor.defaultCSS,t},t.prototype.createProgressElement=function(){var t;return t=document.createElement("div"),t.className="turbolinks-progress-bar",t},t}()}.call(this),function(){var e=function(t,e){return function(){return t.apply(e,arguments)}};t.BrowserAdapter=function(){function r(r){this.controller=r,this.showProgressBar=e(this.showProgressBar,this),this.progressBar=new t.ProgressBar}var n,o,i,s;return s=t.HttpRequest,n=s.NETWORK_FAILURE,i=s.TIMEOUT_FAILURE,o=500,r.prototype.visitProposedToLocationWithAction=function(t,e){return this.controller.startVisitToLocationWithAction(t,e)},r.prototype.visitStarted=function(t){return t.issueRequest(),t.changeHistory(),t.loadCachedSnapshot()},r.prototype.visitRequestStarted=function(t){return this.progressBar.setValue(0),t.hasCachedSnapshot()||"restore"!==t.action?this.showProgressBarAfterDelay():this.showProgressBar()},r.prototype.visitRequestProgressed=function(t){return this.progressBar.setValue(t.progress)},r.prototype.visitRequestCompleted=function(t){return t.loadResponse()},r.prototype.visitRequestFailedWithStatusCode=function(t,e){switch(e){case n:case i:return this.reload();default:return t.loadResponse()}},r.prototype.visitRequestFinished=function(t){return this.hideProgressBar()},r.prototype.visitCompleted=function(t){return t.followRedirect()},r.prototype.pageInvalidated=function(){return this.reload()},r.prototype.showProgressBarAfterDelay=function(){return this.progressBarTimeout=setTimeout(this.showProgressBar,o)},r.prototype.showProgressBar=function(){return this.progressBar.show()},r.prototype.hideProgressBar=function(){return this.progressBar.hide(),clearTimeout(this.progressBarTimeout)},r.prototype.reload=function(){return window.location.reload()},r}()}.call(this),function(){var e,r=function(t,e){return function(){return t.apply(e,arguments)}};e=!1,addEventListener("load",function(){return t.defer(function(){return e=!0})},!1),t.History=function(){function n(t){this.delegate=t,this.onPopState=r(this.onPopState,this)}return n.prototype.start=function(){return this.started?void 0:(addEventListener("popstate",this.onPopState,!1),this.started=!0)},n.prototype.stop=function(){return this.started?(removeEventListener("popstate",this.onPopState,!1),this.started=!1):void 0},n.prototype.push=function(e,r){return e=t.Location.wrap(e),this.update("push",e,r)},n.prototype.replace=function(e,r){return e=t.Location.wrap(e),this.update("replace",e,r)},n.prototype.onPopState=function(e){var r,n,o,i;return this.shouldHandlePopState()&&(i=null!=(n=e.state)?n.turbolinks:void 0)?(r=t.Location.wrap(window.location),o=i.restorationIdentifier,this.delegate.historyPoppedToLocationWithRestorationIdentifier(r,o)):void 0},n.prototype.shouldHandlePopState=function(){return e===!0},n.prototype.update=function(t,e,r){var n;return n={turbolinks:{restorationIdentifier:r}},history[t+"State"](n,null,e)},n}()}.call(this),function(){t.Snapshot=function(){function e(t){var e,r;r=t.head,e=t.body,this.head=null!=r?r:document.createElement("head"),this.body=null!=e?e:document.createElement("body")}return e.wrap=function(t){return t instanceof this?t:this.fromHTML(t)},e.fromHTML=function(t){var e;return e=document.createElement("html"),e.innerHTML=t,this.fromElement(e)},e.fromElement=function(t){return new this({head:t.querySelector("head"),body:t.querySelector("body")})},e.prototype.clone=function(){return new e({head:this.head.cloneNode(!0),body:this.body.cloneNode(!0)})},e.prototype.getRootLocation=function(){var e,r;return r=null!=(e=this.getSetting("root"))?e:"/",new t.Location(r)},e.prototype.getCacheControlValue=function(){return this.getSetting("cache-control")},e.prototype.hasAnchor=function(t){try{return null!=this.body.querySelector("[id='"+t+"']")}catch(e){}},e.prototype.isPreviewable=function(){return"no-preview"!==this.getCacheControlValue()},e.prototype.isCacheable=function(){return"no-cache"!==this.getCacheControlValue()},e.prototype.getSetting=function(t){var e,r;return r=this.head.querySelectorAll("meta[name='turbolinks-"+t+"']"),e=r[r.length-1],null!=e?e.getAttribute("content"):void 0},e}()}.call(this),function(){var e=[].slice;t.Renderer=function(){function t(){}var r;return t.render=function(){var t,r,n,o;return n=arguments[0],r=arguments[1],t=3<=arguments.length?e.call(arguments,2):[],o=function(t,e,r){r.prototype=t.prototype;var n=new r,o=t.apply(n,e);return Object(o)===o?o:n}(this,t,function(){}),o.delegate=n,o.render(r),o},t.prototype.renderView=function(t){return this.delegate.viewWillRender(this.newBody),t(),this.delegate.viewRendered(this.newBody)},t.prototype.invalidateView=function(){return this.delegate.viewInvalidated()},t.prototype.createScriptElement=function(t){var e;return"false"===t.getAttribute("data-turbolinks-eval")?t:(e=document.createElement("script"),e.textContent=t.textContent,r(e,t),e)},r=function(t,e){var r,n,o,i,s,a,u;for(i=e.attributes,a=[],r=0,n=i.length;n>r;r++)s=i[r],o=s.name,u=s.value,a.push(t.setAttribute(o,u));return a},t}()}.call(this),function(){t.HeadDetails=function(){function t(t){var e,r,i,s,a,u,c;for(this.element=t,this.elements={},c=this.element.childNodes,s=0,u=c.length;u>s;s++)i=c[s],i.nodeType===Node.ELEMENT_NODE&&(a=i.outerHTML,r=null!=(e=this.elements)[a]?e[a]:e[a]={type:o(i),tracked:n(i),elements:[]},r.elements.push(i))}var e,r,n,o;return t.prototype.hasElementWithKey=function(t){return t in this.elements},t.prototype.getTrackedElementSignature=function(){var t,e;return function(){var r,n;r=this.elements,n=[];for(t in r)e=r[t].tracked,e&&n.push(t);return n}.call(this).join("")},t.prototype.getScriptElementsNotInDetails=function(t){return this.getElementsMatchingTypeNotInDetails("script",t)},t.prototype.getStylesheetElementsNotInDetails=function(t){return this.getElementsMatchingTypeNotInDetails("stylesheet",t)},t.prototype.getElementsMatchingTypeNotInDetails=function(t,e){var r,n,o,i,s,a;o=this.elements,s=[];for(n in o)i=o[n],a=i.type,r=i.elements,a!==t||e.hasElementWithKey(n)||s.push(r[0]);return s},t.prototype.getProvisionalElements=function(){var t,e,r,n,o,i,s;r=[],n=this.elements;for(e in n)o=n[e],s=o.type,i=o.tracked,t=o.elements,null!=s||i?t.length>1&&r.push.apply(r,t.slice(1)):r.push.apply(r,t);return r},o=function(t){return e(t)?"script":r(t)?"stylesheet":void 0},n=function(t){return"reload"===t.getAttribute("data-turbolinks-track")},e=function(t){var e;return e=t.tagName.toLowerCase(),"script"===e},r=function(t){var e;return e=t.tagName.toLowerCase(),"style"===e||"link"===e&&"stylesheet"===t.getAttribute("rel")},t}()}.call(this),function(){var e=function(t,e){function n(){this.constructor=t}for(var o in e)r.call(e,o)&&(t[o]=e[o]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t.SnapshotRenderer=function(r){function n(e,r){this.currentSnapshot=e,this.newSnapshot=r,this.currentHeadDetails=new t.HeadDetails(this.currentSnapshot.head),this.newHeadDetails=new t.HeadDetails(this.newSnapshot.head),this.newBody=this.newSnapshot.body}return e(n,r),n.prototype.render=function(t){return this.trackedElementsAreIdentical()?(this.mergeHead(),this.renderView(function(e){return function(){return e.replaceBody(),e.focusFirstAutofocusableElement(),t()}}(this))):this.invalidateView()},n.prototype.mergeHead=function(){return this.copyNewHeadStylesheetElements(),this.copyNewHeadScriptElements(),this.removeCurrentHeadProvisionalElements(),this.copyNewHeadProvisionalElements()},n.prototype.replaceBody=function(){return this.activateBodyScriptElements(),this.importBodyPermanentElements(),this.assignNewBody()},n.prototype.trackedElementsAreIdentical=function(){return this.currentHeadDetails.getTrackedElementSignature()===this.newHeadDetails.getTrackedElementSignature()},n.prototype.copyNewHeadStylesheetElements=function(){var t,e,r,n,o;for(n=this.getNewHeadStylesheetElements(),o=[],e=0,r=n.length;r>e;e++)t=n[e],o.push(document.head.appendChild(t));return o},n.prototype.copyNewHeadScriptElements=function(){var t,e,r,n,o;for(n=this.getNewHeadScriptElements(),o=[],e=0,r=n.length;r>e;e++)t=n[e],o.push(document.head.appendChild(this.createScriptElement(t)));return o},n.prototype.removeCurrentHeadProvisionalElements=function(){var t,e,r,n,o;for(n=this.getCurrentHeadProvisionalElements(),o=[],e=0,r=n.length;r>e;e++)t=n[e],o.push(document.head.removeChild(t));return o},n.prototype.copyNewHeadProvisionalElements=function(){var t,e,r,n,o;for(n=this.getNewHeadProvisionalElements(),o=[],e=0,r=n.length;r>e;e++)t=n[e],o.push(document.head.appendChild(t));return o},n.prototype.importBodyPermanentElements=function(){var t,e,r,n,o,i;for(n=this.getNewBodyPermanentElements(),i=[],e=0,r=n.length;r>e;e++)o=n[e],(t=this.findCurrentBodyPermanentElement(o))?i.push(o.parentNode.replaceChild(t,o)):i.push(void 0);return i},n.prototype.activateBodyScriptElements=function(){var t,e,r,n,o,i;for(n=this.getNewBodyScriptElements(),i=[],e=0,r=n.length;r>e;e++)o=n[e],t=this.createScriptElement(o),i.push(o.parentNode.replaceChild(t,o));return i},n.prototype.assignNewBody=function(){return document.body=this.newBody},n.prototype.focusFirstAutofocusableElement=function(){var t;return null!=(t=this.findFirstAutofocusableElement())?t.focus():void 0},n.prototype.getNewHeadStylesheetElements=function(){return this.newHeadDetails.getStylesheetElementsNotInDetails(this.currentHeadDetails)},n.prototype.getNewHeadScriptElements=function(){return this.newHeadDetails.getScriptElementsNotInDetails(this.currentHeadDetails)},n.prototype.getCurrentHeadProvisionalElements=function(){return this.currentHeadDetails.getProvisionalElements()},n.prototype.getNewHeadProvisionalElements=function(){return this.newHeadDetails.getProvisionalElements()},n.prototype.getNewBodyPermanentElements=function(){return this.newBody.querySelectorAll("[id][data-turbolinks-permanent]")},n.prototype.findCurrentBodyPermanentElement=function(t){return document.body.querySelector("#"+t.id+"[data-turbolinks-permanent]")},n.prototype.getNewBodyScriptElements=function(){return this.newBody.querySelectorAll("script")},n.prototype.findFirstAutofocusableElement=function(){return document.body.querySelector("[autofocus]")},n}(t.Renderer)}.call(this),function(){var e=function(t,e){function n(){this.constructor=t}for(var o in e)r.call(e,o)&&(t[o]=e[o]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;t.ErrorRenderer=function(t){function r(t){this.html=t}return e(r,t),r.prototype.render=function(t){return this.renderView(function(e){return function(){return e.replaceDocumentHTML(),e.activateBodyScriptElements(),t()}}(this))},r.prototype.replaceDocumentHTML=function(){return document.documentElement.innerHTML=this.html},r.prototype.activateBodyScriptElements=function(){var t,e,r,n,o,i;for(n=this.getScriptElements(),i=[],e=0,r=n.length;r>e;e++)o=n[e],t=this.createScriptElement(o),i.push(o.parentNode.replaceChild(t,o));return i},r.prototype.getScriptElements=function(){return document.documentElement.querySelectorAll("script")},r}(t.Renderer)}.call(this),function(){t.View=function(){function e(t){this.delegate=t,this.element=document.documentElement}return e.prototype.getRootLocation=function(){return this.getSnapshot().getRootLocation()},e.prototype.getSnapshot=function(){return t.Snapshot.fromElement(this.element)},e.prototype.render=function(t,e){var r,n,o;return o=t.snapshot,r=t.error,n=t.isPreview,this.markAsPreview(n),null!=o?this.renderSnapshot(o,e):this.renderError(r,e)},e.prototype.markAsPreview=function(t){return t?this.element.setAttribute("data-turbolinks-preview",""):this.element.removeAttribute("data-turbolinks-preview")},e.prototype.renderSnapshot=function(e,r){return t.SnapshotRenderer.render(this.delegate,r,this.getSnapshot(),t.Snapshot.wrap(e))},e.prototype.renderError=function(e,r){return t.ErrorRenderer.render(this.delegate,r,e)},e}()}.call(this),function(){var e=function(t,e){return function(){return t.apply(e,arguments)}};t.ScrollManager=function(){function t(t){this.delegate=t,this.onScroll=e(this.onScroll,this)}return t.prototype.start=function(){return this.started?void 0:(addEventListener("scroll",this.onScroll,!1),this.onScroll(),this.started=!0)},t.prototype.stop=function(){return this.started?(removeEventListener("scroll",this.onScroll,!1),this.started=!1):void 0},t.prototype.scrollToElement=function(t){return t.scrollIntoView()},t.prototype.scrollToPosition=function(t){var e,r;return e=t.x,r=t.y,window.scrollTo(e,r)},t.prototype.onScroll=function(t){return this.updatePosition({x:window.pageXOffset,y:window.pageYOffset})},t.prototype.updatePosition=function(t){var e;return this.position=t,null!=(e=this.delegate)?e.scrollPositionChanged(this.position):void 0},t}()}.call(this),function(){t.SnapshotCache=function(){function e(t){this.size=t,this.keys=[],this.snapshots={}}var r;return e.prototype.has=function(t){var e;return e=r(t),e in this.snapshots},e.prototype.get=function(t){var e;if(this.has(t))return e=this.read(t),this.touch(t),e},e.prototype.put=function(t,e){return this.write(t,e),this.touch(t),e},e.prototype.read=function(t){var e;return e=r(t),this.snapshots[e]},e.prototype.write=function(t,e){var n;return n=r(t),this.snapshots[n]=e},e.prototype.touch=function(t){var e,n;return n=r(t),e=this.keys.indexOf(n),e>-1&&this.keys.splice(e,1),this.keys.unshift(n),this.trim()},e.prototype.trim=function(){var t,e,r,n,o;for(n=this.keys.splice(this.size),o=[],t=0,r=n.length;r>t;t++)e=n[t],o.push(delete this.snapshots[e]);return o},r=function(e){return t.Location.wrap(e).toCacheKey()},e}()}.call(this),function(){var e=function(t,e){return function(){return t.apply(e,arguments)}};t.Visit=function(){function r(r,n,o){this.controller=r,this.action=o,this.performScroll=e(this.performScroll,this),this.identifier=t.uuid(),this.location=t.Location.wrap(n),this.adapter=this.controller.adapter,this.state="initialized",this.timingMetrics={}}var n;return r.prototype.start=function(){return"initialized"===this.state?(this.recordTimingMetric("visitStart"),this.state="started",this.adapter.visitStarted(this)):void 0},r.prototype.cancel=function(){var t;return"started"===this.state?(null!=(t=this.request)&&t.cancel(),this.cancelRender(),this.state="canceled"):void 0},r.prototype.complete=function(){var t;return"started"===this.state?(this.recordTimingMetric("visitEnd"),this.state="completed","function"==typeof(t=this.adapter).visitCompleted&&t.visitCompleted(this),this.controller.visitCompleted(this)):void 0},r.prototype.fail=function(){var t;return"started"===this.state?(this.state="failed","function"==typeof(t=this.adapter).visitFailed?t.visitFailed(this):void 0):void 0},r.prototype.changeHistory=function(){var t,e;return this.historyChanged?void 0:(t=this.location.isEqualTo(this.referrer)?"replace":this.action,e=n(t),this.controller[e](this.location,this.restorationIdentifier),this.historyChanged=!0)},r.prototype.issueRequest=function(){return this.shouldIssueRequest()&&null==this.request?(this.progress=0,this.request=new t.HttpRequest(this,this.location,this.referrer),this.request.send()):void 0},r.prototype.getCachedSnapshot=function(){var t;return!(t=this.controller.getCachedSnapshotForLocation(this.location))||null!=this.location.anchor&&!t.hasAnchor(this.location.anchor)||"restore"!==this.action&&!t.isPreviewable()?void 0:t},r.prototype.hasCachedSnapshot=function(){return null!=this.getCachedSnapshot()},r.prototype.loadCachedSnapshot=function(){var t,e;return(e=this.getCachedSnapshot())?(t=this.shouldIssueRequest(),this.render(function(){var r;return this.cacheSnapshot(),this.controller.render({snapshot:e,isPreview:t},this.performScroll),"function"==typeof(r=this.adapter).visitRendered&&r.visitRendered(this),t?void 0:this.complete()})):void 0},r.prototype.loadResponse=function(){return null!=this.response?this.render(function(){var t,e;return this.cacheSnapshot(),this.request.failed?(this.controller.render({error:this.response},this.performScroll),"function"==typeof(t=this.adapter).visitRendered&&t.visitRendered(this),this.fail()):(this.controller.render({snapshot:this.response},this.performScroll),"function"==typeof(e=this.adapter).visitRendered&&e.visitRendered(this),this.complete())}):void 0},r.prototype.followRedirect=function(){return this.redirectedToLocation&&!this.followedRedirect?(this.location=this.redirectedToLocation,this.controller.replaceHistoryWithLocationAndRestorationIdentifier(this.redirectedToLocation,this.restorationIdentifier),this.followedRedirect=!0):void 0},r.prototype.requestStarted=function(){var t;return this.recordTimingMetric("requestStart"),"function"==typeof(t=this.adapter).visitRequestStarted?t.visitRequestStarted(this):void 0},r.prototype.requestProgressed=function(t){var e;return this.progress=t,"function"==typeof(e=this.adapter).visitRequestProgressed?e.visitRequestProgressed(this):void 0},r.prototype.requestCompletedWithResponse=function(e,r){return this.response=e,null!=r&&(this.redirectedToLocation=t.Location.wrap(r)),this.adapter.visitRequestCompleted(this)},r.prototype.requestFailedWithStatusCode=function(t,e){return this.response=e,this.adapter.visitRequestFailedWithStatusCode(this,t)},r.prototype.requestFinished=function(){var t;return this.recordTimingMetric("requestEnd"),"function"==typeof(t=this.adapter).visitRequestFinished?t.visitRequestFinished(this):void 0},r.prototype.performScroll=function(){return this.scrolled?void 0:("restore"===this.action?this.scrollToRestoredPosition()||this.scrollToTop():this.scrollToAnchor()||this.scrollToTop(),this.scrolled=!0)},r.prototype.scrollToRestoredPosition=function(){var t,e;return t=null!=(e=this.restorationData)?e.scrollPosition:void 0,null!=t?(this.controller.scrollToPosition(t),!0):void 0},r.prototype.scrollToAnchor=function(){return null!=this.location.anchor?(this.controller.scrollToAnchor(this.location.anchor),!0):void 0},r.prototype.scrollToTop=function(){return this.controller.scrollToPosition({x:0,y:0})},r.prototype.recordTimingMetric=function(t){var e;return null!=(e=this.timingMetrics)[t]?e[t]:e[t]=(new Date).getTime()},r.prototype.getTimingMetrics=function(){return t.copyObject(this.timingMetrics)},n=function(t){switch(t){case"replace":return"replaceHistoryWithLocationAndRestorationIdentifier";case"advance":case"restore":return"pushHistoryWithLocationAndRestorationIdentifier"}},r.prototype.shouldIssueRequest=function(){return"restore"===this.action?!this.hasCachedSnapshot():!0},r.prototype.cacheSnapshot=function(){return this.snapshotCached?void 0:(this.controller.cacheSnapshot(),this.snapshotCached=!0)},r.prototype.render=function(t){return this.cancelRender(),this.frame=requestAnimationFrame(function(e){return function(){return e.frame=null,t.call(e)}}(this))},r.prototype.cancelRender=function(){return this.frame?cancelAnimationFrame(this.frame):void 0},r}()}.call(this),function(){var e=function(t,e){return function(){return t.apply(e,arguments)}};t.Controller=function(){function r(){this.clickBubbled=e(this.clickBubbled,this),this.clickCaptured=e(this.clickCaptured,this),this.pageLoaded=e(this.pageLoaded,this),this.history=new t.History(this),this.view=new t.View(this),this.scrollManager=new t.ScrollManager(this),this.restorationData={},this.clearCache()}return r.prototype.start=function(){return t.supported&&!this.started?(addEventListener("click",this.clickCaptured,!0),addEventListener("DOMContentLoaded",this.pageLoaded,!1),this.scrollManager.start(),this.startHistory(),this.started=!0,this.enabled=!0):void 0},r.prototype.disable=function(){return this.enabled=!1},r.prototype.stop=function(){return this.started?(removeEventListener("click",this.clickCaptured,!0),removeEventListener("DOMContentLoaded",this.pageLoaded,!1),this.scrollManager.stop(),this.stopHistory(),this.started=!1):void 0},r.prototype.clearCache=function(){return this.cache=new t.SnapshotCache(10)},r.prototype.visit=function(e,r){var n,o;return null==r&&(r={}),e=t.Location.wrap(e),this.applicationAllowsVisitingLocation(e)?this.locationIsVisitable(e)?(n=null!=(o=r.action)?o:"advance",this.adapter.visitProposedToLocationWithAction(e,n)):window.location=e:void 0},r.prototype.startVisitToLocationWithAction=function(e,r,n){var o;return t.supported?(o=this.getRestorationDataForIdentifier(n),this.startVisit(e,r,{restorationData:o})):window.location=e},r.prototype.startHistory=function(){return this.location=t.Location.wrap(window.location),this.restorationIdentifier=t.uuid(),this.history.start(),this.history.replace(this.location,this.restorationIdentifier)},r.prototype.stopHistory=function(){return this.history.stop()},r.prototype.pushHistoryWithLocationAndRestorationIdentifier=function(e,r){return this.restorationIdentifier=r,this.location=t.Location.wrap(e),this.history.push(this.location,this.restorationIdentifier)},r.prototype.replaceHistoryWithLocationAndRestorationIdentifier=function(e,r){return this.restorationIdentifier=r,this.location=t.Location.wrap(e),this.history.replace(this.location,this.restorationIdentifier)},r.prototype.historyPoppedToLocationWithRestorationIdentifier=function(e,r){var n;return this.restorationIdentifier=r,this.enabled?(n=this.getRestorationDataForIdentifier(this.restorationIdentifier),this.startVisit(e,"restore",{restorationIdentifier:this.restorationIdentifier,restorationData:n,historyChanged:!0}),this.location=t.Location.wrap(e)):this.adapter.pageInvalidated()},r.prototype.getCachedSnapshotForLocation=function(t){var e;return e=this.cache.get(t),e?e.clone():void 0},r.prototype.shouldCacheSnapshot=function(){return this.view.getSnapshot().isCacheable()},r.prototype.cacheSnapshot=function(){var t;return this.shouldCacheSnapshot()?(this.notifyApplicationBeforeCachingSnapshot(),t=this.view.getSnapshot(),this.cache.put(this.lastRenderedLocation,t.clone())):void 0},r.prototype.scrollToAnchor=function(t){var e;return(e=document.getElementById(t))?this.scrollToElement(e):this.scrollToPosition({x:0,y:0})},r.prototype.scrollToElement=function(t){return this.scrollManager.scrollToElement(t)},r.prototype.scrollToPosition=function(t){return this.scrollManager.scrollToPosition(t)},r.prototype.scrollPositionChanged=function(t){var e;return e=this.getCurrentRestorationData(),e.scrollPosition=t},r.prototype.render=function(t,e){return this.view.render(t,e)},r.prototype.viewInvalidated=function(){return this.adapter.pageInvalidated()},r.prototype.viewWillRender=function(t){return this.notifyApplicationBeforeRender(t)},r.prototype.viewRendered=function(){return this.lastRenderedLocation=this.currentVisit.location,this.notifyApplicationAfterRender()},r.prototype.pageLoaded=function(){return this.lastRenderedLocation=this.location,this.notifyApplicationAfterPageLoad()},r.prototype.clickCaptured=function(){return removeEventListener("click",this.clickBubbled,!1),addEventListener("click",this.clickBubbled,!1)},r.prototype.clickBubbled=function(t){var e,r,n;return this.enabled&&this.clickEventIsSignificant(t)&&(r=this.getVisitableLinkForNode(t.target))&&(n=this.getVisitableLocationForLink(r))&&this.applicationAllowsFollowingLinkToLocation(r,n)?(t.preventDefault(),e=this.getActionForLink(r),this.visit(n,{action:e})):void 0},r.prototype.applicationAllowsFollowingLinkToLocation=function(t,e){var r;return r=this.notifyApplicationAfterClickingLinkToLocation(t,e),!r.defaultPrevented},r.prototype.applicationAllowsVisitingLocation=function(t){var e;return e=this.notifyApplicationBeforeVisitingLocation(t),!e.defaultPrevented},r.prototype.notifyApplicationAfterClickingLinkToLocation=function(e,r){return t.dispatch("turbolinks:click",{target:e,data:{url:r.absoluteURL},cancelable:!0})},r.prototype.notifyApplicationBeforeVisitingLocation=function(e){return t.dispatch("turbolinks:before-visit",{data:{url:e.absoluteURL},cancelable:!0})},r.prototype.notifyApplicationAfterVisitingLocation=function(e){return t.dispatch("turbolinks:visit",{data:{url:e.absoluteURL}})},r.prototype.notifyApplicationBeforeCachingSnapshot=function(){return t.dispatch("turbolinks:before-cache")},r.prototype.notifyApplicationBeforeRender=function(e){return t.dispatch("turbolinks:before-render",{data:{newBody:e}})},r.prototype.notifyApplicationAfterRender=function(){return t.dispatch("turbolinks:render")},r.prototype.notifyApplicationAfterPageLoad=function(e){return null==e&&(e={}),t.dispatch("turbolinks:load",{data:{url:this.location.absoluteURL,timing:e}})},r.prototype.startVisit=function(t,e,r){var n;return null!=(n=this.currentVisit)&&n.cancel(),this.currentVisit=this.createVisit(t,e,r),this.currentVisit.start(),this.notifyApplicationAfterVisitingLocation(t)},r.prototype.createVisit=function(e,r,n){
7
7
  var o,i,s,a,u;return i=null!=n?n:{},a=i.restorationIdentifier,s=i.restorationData,o=i.historyChanged,u=new t.Visit(this,e,r),u.restorationIdentifier=null!=a?a:t.uuid(),u.restorationData=t.copyObject(s),u.historyChanged=o,u.referrer=this.location,u},r.prototype.visitCompleted=function(t){return this.notifyApplicationAfterPageLoad(t.getTimingMetrics())},r.prototype.clickEventIsSignificant=function(t){return!(t.defaultPrevented||t.target.isContentEditable||t.which>1||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey)},r.prototype.getVisitableLinkForNode=function(e){return this.nodeIsVisitable(e)?t.closest(e,"a[href]:not([target])"):void 0},r.prototype.getVisitableLocationForLink=function(e){var r;return r=new t.Location(e.getAttribute("href")),this.locationIsVisitable(r)?r:void 0},r.prototype.getActionForLink=function(t){var e;return null!=(e=t.getAttribute("data-turbolinks-action"))?e:"advance"},r.prototype.nodeIsVisitable=function(e){var r;return(r=t.closest(e,"[data-turbolinks]"))?"false"!==r.getAttribute("data-turbolinks"):!0},r.prototype.locationIsVisitable=function(t){return t.isPrefixedBy(this.view.getRootLocation())&&t.isHTML()},r.prototype.getCurrentRestorationData=function(){return this.getRestorationDataForIdentifier(this.restorationIdentifier)},r.prototype.getRestorationDataForIdentifier=function(t){var e;return null!=(e=this.restorationData)[t]?e[t]:e[t]={}},r}()}.call(this),function(){var e,r,n;t.start=function(){return r()?(null==t.controller&&(t.controller=e()),t.controller.start()):void 0},r=function(){return null==window.Turbolinks&&(window.Turbolinks=t),n()},e=function(){var e;return e=new t.Controller,e.adapter=new t.BrowserAdapter(e),e},n=function(){return window.Turbolinks===t},n()&&t.start()}.call(this)}).call(this),"object"==typeof module&&module.exports?module.exports=t:"function"==typeof define&&define.amd&&define(t)}).call(this);
8
- /*eslint-disable no-unused-vars*/
9
8
  /*!
10
- * jQuery JavaScript Library v3.1.0
9
+ * jQuery JavaScript Library v3.1.1
11
10
  * https://jquery.com/
12
11
  *
13
12
  * Includes Sizzle.js
@@ -17,7 +16,7 @@ var o,i,s,a,u;return i=null!=n?n:{},a=i.restorationIdentifier,s=i.restorationDat
17
16
  * Released under the MIT license
18
17
  * https://jquery.org/license
19
18
  *
20
- * Date: 2016-07-07T21:44Z
19
+ * Date: 2016-09-22T22:30Z
21
20
  */
22
21
 
23
22
  ( function( global, factory ) {
@@ -91,13 +90,13 @@ var support = {};
91
90
  doc.head.appendChild( script ).parentNode.removeChild( script );
92
91
  }
93
92
  /* global Symbol */
94
- // Defining this global in .eslintrc would create a danger of using the global
93
+ // Defining this global in .eslintrc.json would create a danger of using the global
95
94
  // unguarded in another place, it seems safer to define global only for this module
96
95
 
97
96
 
98
97
 
99
98
  var
100
- version = "3.1.0",
99
+ version = "3.1.1",
101
100
 
102
101
  // Define a local copy of jQuery
103
102
  jQuery = function( selector, context ) {
@@ -137,13 +136,14 @@ jQuery.fn = jQuery.prototype = {
137
136
  // Get the Nth element in the matched element set OR
138
137
  // Get the whole matched element set as a clean array
139
138
  get: function( num ) {
140
- return num != null ?
141
139
 
142
- // Return just the one element from the set
143
- ( num < 0 ? this[ num + this.length ] : this[ num ] ) :
140
+ // Return all the elements in a clean array
141
+ if ( num == null ) {
142
+ return slice.call( this );
143
+ }
144
144
 
145
- // Return all the elements in a clean array
146
- slice.call( this );
145
+ // Return just the one element from the set
146
+ return num < 0 ? this[ num + this.length ] : this[ num ];
147
147
  },
148
148
 
149
149
  // Take an array of elements and push it onto the stack
@@ -551,14 +551,14 @@ function isArrayLike( obj ) {
551
551
  }
552
552
  var Sizzle =
553
553
  /*!
554
- * Sizzle CSS Selector Engine v2.3.0
554
+ * Sizzle CSS Selector Engine v2.3.3
555
555
  * https://sizzlejs.com/
556
556
  *
557
557
  * Copyright jQuery Foundation and other contributors
558
558
  * Released under the MIT license
559
559
  * http://jquery.org/license
560
560
  *
561
- * Date: 2016-01-04
561
+ * Date: 2016-08-08
562
562
  */
563
563
  (function( window ) {
564
564
 
@@ -704,7 +704,7 @@ var i,
704
704
 
705
705
  // CSS string/identifier serialization
706
706
  // https://drafts.csswg.org/cssom/#common-serializing-idioms
707
- rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,
707
+ rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
708
708
  fcssescape = function( ch, asCodePoint ) {
709
709
  if ( asCodePoint ) {
710
710
 
@@ -731,7 +731,7 @@ var i,
731
731
 
732
732
  disabledAncestor = addCombinator(
733
733
  function( elem ) {
734
- return elem.disabled === true;
734
+ return elem.disabled === true && ("form" in elem || "label" in elem);
735
735
  },
736
736
  { dir: "parentNode", next: "legend" }
737
737
  );
@@ -1017,26 +1017,54 @@ function createButtonPseudo( type ) {
1017
1017
  * @param {Boolean} disabled true for :disabled; false for :enabled
1018
1018
  */
1019
1019
  function createDisabledPseudo( disabled ) {
1020
- // Known :disabled false positives:
1021
- // IE: *[disabled]:not(button, input, select, textarea, optgroup, option, menuitem, fieldset)
1022
- // not IE: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
1020
+
1021
+ // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
1023
1022
  return function( elem ) {
1024
1023
 
1025
- // Check form elements and option elements for explicit disabling
1026
- return "label" in elem && elem.disabled === disabled ||
1027
- "form" in elem && elem.disabled === disabled ||
1024
+ // Only certain elements can match :enabled or :disabled
1025
+ // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
1026
+ // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
1027
+ if ( "form" in elem ) {
1028
+
1029
+ // Check for inherited disabledness on relevant non-disabled elements:
1030
+ // * listed form-associated elements in a disabled fieldset
1031
+ // https://html.spec.whatwg.org/multipage/forms.html#category-listed
1032
+ // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
1033
+ // * option elements in a disabled optgroup
1034
+ // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
1035
+ // All such elements have a "form" property.
1036
+ if ( elem.parentNode && elem.disabled === false ) {
1037
+
1038
+ // Option elements defer to a parent optgroup if present
1039
+ if ( "label" in elem ) {
1040
+ if ( "label" in elem.parentNode ) {
1041
+ return elem.parentNode.disabled === disabled;
1042
+ } else {
1043
+ return elem.disabled === disabled;
1044
+ }
1045
+ }
1028
1046
 
1029
- // Check non-disabled form elements for fieldset[disabled] ancestors
1030
- "form" in elem && elem.disabled === false && (
1031
- // Support: IE6-11+
1032
- // Ancestry is covered for us
1033
- elem.isDisabled === disabled ||
1047
+ // Support: IE 6 - 11
1048
+ // Use the isDisabled shortcut property to check for disabled fieldset ancestors
1049
+ return elem.isDisabled === disabled ||
1034
1050
 
1035
- // Otherwise, assume any non-<option> under fieldset[disabled] is disabled
1036
- /* jshint -W018 */
1037
- elem.isDisabled !== !disabled &&
1038
- ("label" in elem || !disabledAncestor( elem )) !== disabled
1039
- );
1051
+ // Where there is no isDisabled, check manually
1052
+ /* jshint -W018 */
1053
+ elem.isDisabled !== !disabled &&
1054
+ disabledAncestor( elem ) === disabled;
1055
+ }
1056
+
1057
+ return elem.disabled === disabled;
1058
+
1059
+ // Try to winnow out elements that can't be disabled before trusting the disabled property.
1060
+ // Some victims get caught in our net (label, legend, menu, track), but it shouldn't
1061
+ // even exist on them, let alone have a boolean value.
1062
+ } else if ( "label" in elem ) {
1063
+ return elem.disabled === disabled;
1064
+ }
1065
+
1066
+ // Remaining elements are neither :enabled nor :disabled
1067
+ return false;
1040
1068
  };
1041
1069
  }
1042
1070
 
@@ -1152,25 +1180,21 @@ setDocument = Sizzle.setDocument = function( node ) {
1152
1180
  return !document.getElementsByName || !document.getElementsByName( expando ).length;
1153
1181
  });
1154
1182
 
1155
- // ID find and filter
1183
+ // ID filter and find
1156
1184
  if ( support.getById ) {
1157
- Expr.find["ID"] = function( id, context ) {
1158
- if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
1159
- var m = context.getElementById( id );
1160
- return m ? [ m ] : [];
1161
- }
1162
- };
1163
1185
  Expr.filter["ID"] = function( id ) {
1164
1186
  var attrId = id.replace( runescape, funescape );
1165
1187
  return function( elem ) {
1166
1188
  return elem.getAttribute("id") === attrId;
1167
1189
  };
1168
1190
  };
1191
+ Expr.find["ID"] = function( id, context ) {
1192
+ if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
1193
+ var elem = context.getElementById( id );
1194
+ return elem ? [ elem ] : [];
1195
+ }
1196
+ };
1169
1197
  } else {
1170
- // Support: IE6/7
1171
- // getElementById is not reliable as a find shortcut
1172
- delete Expr.find["ID"];
1173
-
1174
1198
  Expr.filter["ID"] = function( id ) {
1175
1199
  var attrId = id.replace( runescape, funescape );
1176
1200
  return function( elem ) {
@@ -1179,6 +1203,36 @@ setDocument = Sizzle.setDocument = function( node ) {
1179
1203
  return node && node.value === attrId;
1180
1204
  };
1181
1205
  };
1206
+
1207
+ // Support: IE 6 - 7 only
1208
+ // getElementById is not reliable as a find shortcut
1209
+ Expr.find["ID"] = function( id, context ) {
1210
+ if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
1211
+ var node, i, elems,
1212
+ elem = context.getElementById( id );
1213
+
1214
+ if ( elem ) {
1215
+
1216
+ // Verify the id attribute
1217
+ node = elem.getAttributeNode("id");
1218
+ if ( node && node.value === id ) {
1219
+ return [ elem ];
1220
+ }
1221
+
1222
+ // Fall back on getElementsByName
1223
+ elems = context.getElementsByName( id );
1224
+ i = 0;
1225
+ while ( (elem = elems[i++]) ) {
1226
+ node = elem.getAttributeNode("id");
1227
+ if ( node && node.value === id ) {
1228
+ return [ elem ];
1229
+ }
1230
+ }
1231
+ }
1232
+
1233
+ return [];
1234
+ }
1235
+ };
1182
1236
  }
1183
1237
 
1184
1238
  // Tag
@@ -2219,6 +2273,7 @@ function addCombinator( matcher, combinator, base ) {
2219
2273
  return matcher( elem, context, xml );
2220
2274
  }
2221
2275
  }
2276
+ return false;
2222
2277
  } :
2223
2278
 
2224
2279
  // Check against all ancestor/preceding elements
@@ -2263,6 +2318,7 @@ function addCombinator( matcher, combinator, base ) {
2263
2318
  }
2264
2319
  }
2265
2320
  }
2321
+ return false;
2266
2322
  };
2267
2323
  }
2268
2324
 
@@ -2625,8 +2681,7 @@ select = Sizzle.select = function( selector, context, results, seed ) {
2625
2681
  // Reduce context if the leading compound selector is an ID
2626
2682
  tokens = match[0] = match[0].slice( 0 );
2627
2683
  if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
2628
- support.getById && context.nodeType === 9 && documentIsHTML &&
2629
- Expr.relative[ tokens[1].type ] ) {
2684
+ context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) {
2630
2685
 
2631
2686
  context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
2632
2687
  if ( !context ) {
@@ -2808,24 +2863,29 @@ function winnow( elements, qualifier, not ) {
2808
2863
  return jQuery.grep( elements, function( elem, i ) {
2809
2864
  return !!qualifier.call( elem, i, elem ) !== not;
2810
2865
  } );
2811
-
2812
2866
  }
2813
2867
 
2868
+ // Single element
2814
2869
  if ( qualifier.nodeType ) {
2815
2870
  return jQuery.grep( elements, function( elem ) {
2816
2871
  return ( elem === qualifier ) !== not;
2817
2872
  } );
2818
-
2819
2873
  }
2820
2874
 
2821
- if ( typeof qualifier === "string" ) {
2822
- if ( risSimple.test( qualifier ) ) {
2823
- return jQuery.filter( qualifier, elements, not );
2824
- }
2875
+ // Arraylike of elements (jQuery, arguments, Array)
2876
+ if ( typeof qualifier !== "string" ) {
2877
+ return jQuery.grep( elements, function( elem ) {
2878
+ return ( indexOf.call( qualifier, elem ) > -1 ) !== not;
2879
+ } );
2880
+ }
2825
2881
 
2826
- qualifier = jQuery.filter( qualifier, elements );
2882
+ // Simple selector that can be filtered directly, removing non-Elements
2883
+ if ( risSimple.test( qualifier ) ) {
2884
+ return jQuery.filter( qualifier, elements, not );
2827
2885
  }
2828
2886
 
2887
+ // Complex selector, compare the two sets, removing non-Elements
2888
+ qualifier = jQuery.filter( qualifier, elements );
2829
2889
  return jQuery.grep( elements, function( elem ) {
2830
2890
  return ( indexOf.call( qualifier, elem ) > -1 ) !== not && elem.nodeType === 1;
2831
2891
  } );
@@ -2838,11 +2898,13 @@ jQuery.filter = function( expr, elems, not ) {
2838
2898
  expr = ":not(" + expr + ")";
2839
2899
  }
2840
2900
 
2841
- return elems.length === 1 && elem.nodeType === 1 ?
2842
- jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
2843
- jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
2844
- return elem.nodeType === 1;
2845
- } ) );
2901
+ if ( elems.length === 1 && elem.nodeType === 1 ) {
2902
+ return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];
2903
+ }
2904
+
2905
+ return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
2906
+ return elem.nodeType === 1;
2907
+ } ) );
2846
2908
  };
2847
2909
 
2848
2910
  jQuery.fn.extend( {
@@ -3170,14 +3232,14 @@ jQuery.each( {
3170
3232
  return this.pushStack( matched );
3171
3233
  };
3172
3234
  } );
3173
- var rnotwhite = ( /\S+/g );
3235
+ var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g );
3174
3236
 
3175
3237
 
3176
3238
 
3177
3239
  // Convert String-formatted options into Object-formatted ones
3178
3240
  function createOptions( options ) {
3179
3241
  var object = {};
3180
- jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
3242
+ jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {
3181
3243
  object[ flag ] = true;
3182
3244
  } );
3183
3245
  return object;
@@ -3942,13 +4004,16 @@ var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
3942
4004
  }
3943
4005
  }
3944
4006
 
3945
- return chainable ?
3946
- elems :
4007
+ if ( chainable ) {
4008
+ return elems;
4009
+ }
4010
+
4011
+ // Gets
4012
+ if ( bulk ) {
4013
+ return fn.call( elems );
4014
+ }
3947
4015
 
3948
- // Gets
3949
- bulk ?
3950
- fn.call( elems ) :
3951
- len ? fn( elems[ 0 ], key ) : emptyGet;
4016
+ return len ? fn( elems[ 0 ], key ) : emptyGet;
3952
4017
  };
3953
4018
  var acceptData = function( owner ) {
3954
4019
 
@@ -4085,7 +4150,7 @@ Data.prototype = {
4085
4150
  // Otherwise, create an array by matching non-whitespace
4086
4151
  key = key in cache ?
4087
4152
  [ key ] :
4088
- ( key.match( rnotwhite ) || [] );
4153
+ ( key.match( rnothtmlwhite ) || [] );
4089
4154
  }
4090
4155
 
4091
4156
  i = key.length;
@@ -4133,6 +4198,31 @@ var dataUser = new Data();
4133
4198
  var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
4134
4199
  rmultiDash = /[A-Z]/g;
4135
4200
 
4201
+ function getData( data ) {
4202
+ if ( data === "true" ) {
4203
+ return true;
4204
+ }
4205
+
4206
+ if ( data === "false" ) {
4207
+ return false;
4208
+ }
4209
+
4210
+ if ( data === "null" ) {
4211
+ return null;
4212
+ }
4213
+
4214
+ // Only convert to a number if it doesn't change the string
4215
+ if ( data === +data + "" ) {
4216
+ return +data;
4217
+ }
4218
+
4219
+ if ( rbrace.test( data ) ) {
4220
+ return JSON.parse( data );
4221
+ }
4222
+
4223
+ return data;
4224
+ }
4225
+
4136
4226
  function dataAttr( elem, key, data ) {
4137
4227
  var name;
4138
4228
 
@@ -4144,14 +4234,7 @@ function dataAttr( elem, key, data ) {
4144
4234
 
4145
4235
  if ( typeof data === "string" ) {
4146
4236
  try {
4147
- data = data === "true" ? true :
4148
- data === "false" ? false :
4149
- data === "null" ? null :
4150
-
4151
- // Only convert to a number if it doesn't change the string
4152
- +data + "" === data ? +data :
4153
- rbrace.test( data ) ? JSON.parse( data ) :
4154
- data;
4237
+ data = getData( data );
4155
4238
  } catch ( e ) {}
4156
4239
 
4157
4240
  // Make sure we set the data so it isn't changed later
@@ -4528,7 +4611,7 @@ function getDefaultDisplay( elem ) {
4528
4611
  return display;
4529
4612
  }
4530
4613
 
4531
- temp = doc.body.appendChild( doc.createElement( nodeName ) ),
4614
+ temp = doc.body.appendChild( doc.createElement( nodeName ) );
4532
4615
  display = jQuery.css( temp, "display" );
4533
4616
 
4534
4617
  temp.parentNode.removeChild( temp );
@@ -4646,15 +4729,23 @@ function getAll( context, tag ) {
4646
4729
 
4647
4730
  // Support: IE <=9 - 11 only
4648
4731
  // Use typeof to avoid zero-argument method invocation on host objects (#15151)
4649
- var ret = typeof context.getElementsByTagName !== "undefined" ?
4650
- context.getElementsByTagName( tag || "*" ) :
4651
- typeof context.querySelectorAll !== "undefined" ?
4652
- context.querySelectorAll( tag || "*" ) :
4653
- [];
4654
-
4655
- return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
4656
- jQuery.merge( [ context ], ret ) :
4657
- ret;
4732
+ var ret;
4733
+
4734
+ if ( typeof context.getElementsByTagName !== "undefined" ) {
4735
+ ret = context.getElementsByTagName( tag || "*" );
4736
+
4737
+ } else if ( typeof context.querySelectorAll !== "undefined" ) {
4738
+ ret = context.querySelectorAll( tag || "*" );
4739
+
4740
+ } else {
4741
+ ret = [];
4742
+ }
4743
+
4744
+ if ( tag === undefined || tag && jQuery.nodeName( context, tag ) ) {
4745
+ return jQuery.merge( [ context ], ret );
4746
+ }
4747
+
4748
+ return ret;
4658
4749
  }
4659
4750
 
4660
4751
 
@@ -4928,7 +5019,7 @@ jQuery.event = {
4928
5019
  }
4929
5020
 
4930
5021
  // Handle multiple events separated by a space
4931
- types = ( types || "" ).match( rnotwhite ) || [ "" ];
5022
+ types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
4932
5023
  t = types.length;
4933
5024
  while ( t-- ) {
4934
5025
  tmp = rtypenamespace.exec( types[ t ] ) || [];
@@ -5010,7 +5101,7 @@ jQuery.event = {
5010
5101
  }
5011
5102
 
5012
5103
  // Once for each type.namespace in types; type may be omitted
5013
- types = ( types || "" ).match( rnotwhite ) || [ "" ];
5104
+ types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
5014
5105
  t = types.length;
5015
5106
  while ( t-- ) {
5016
5107
  tmp = rtypenamespace.exec( types[ t ] ) || [];
@@ -5136,51 +5227,58 @@ jQuery.event = {
5136
5227
  },
5137
5228
 
5138
5229
  handlers: function( event, handlers ) {
5139
- var i, matches, sel, handleObj,
5230
+ var i, handleObj, sel, matchedHandlers, matchedSelectors,
5140
5231
  handlerQueue = [],
5141
5232
  delegateCount = handlers.delegateCount,
5142
5233
  cur = event.target;
5143
5234
 
5144
- // Support: IE <=9
5145
5235
  // Find delegate handlers
5146
- // Black-hole SVG <use> instance trees (#13180)
5147
- //
5148
- // Support: Firefox <=42
5149
- // Avoid non-left-click in FF but don't block IE radio events (#3861, gh-2343)
5150
- if ( delegateCount && cur.nodeType &&
5151
- ( event.type !== "click" || isNaN( event.button ) || event.button < 1 ) ) {
5236
+ if ( delegateCount &&
5237
+
5238
+ // Support: IE <=9
5239
+ // Black-hole SVG <use> instance trees (trac-13180)
5240
+ cur.nodeType &&
5241
+
5242
+ // Support: Firefox <=42
5243
+ // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)
5244
+ // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click
5245
+ // Support: IE 11 only
5246
+ // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)
5247
+ !( event.type === "click" && event.button >= 1 ) ) {
5152
5248
 
5153
5249
  for ( ; cur !== this; cur = cur.parentNode || this ) {
5154
5250
 
5155
5251
  // Don't check non-elements (#13208)
5156
5252
  // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
5157
- if ( cur.nodeType === 1 && ( cur.disabled !== true || event.type !== "click" ) ) {
5158
- matches = [];
5253
+ if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
5254
+ matchedHandlers = [];
5255
+ matchedSelectors = {};
5159
5256
  for ( i = 0; i < delegateCount; i++ ) {
5160
5257
  handleObj = handlers[ i ];
5161
5258
 
5162
5259
  // Don't conflict with Object.prototype properties (#13203)
5163
5260
  sel = handleObj.selector + " ";
5164
5261
 
5165
- if ( matches[ sel ] === undefined ) {
5166
- matches[ sel ] = handleObj.needsContext ?
5262
+ if ( matchedSelectors[ sel ] === undefined ) {
5263
+ matchedSelectors[ sel ] = handleObj.needsContext ?
5167
5264
  jQuery( sel, this ).index( cur ) > -1 :
5168
5265
  jQuery.find( sel, this, null, [ cur ] ).length;
5169
5266
  }
5170
- if ( matches[ sel ] ) {
5171
- matches.push( handleObj );
5267
+ if ( matchedSelectors[ sel ] ) {
5268
+ matchedHandlers.push( handleObj );
5172
5269
  }
5173
5270
  }
5174
- if ( matches.length ) {
5175
- handlerQueue.push( { elem: cur, handlers: matches } );
5271
+ if ( matchedHandlers.length ) {
5272
+ handlerQueue.push( { elem: cur, handlers: matchedHandlers } );
5176
5273
  }
5177
5274
  }
5178
5275
  }
5179
5276
  }
5180
5277
 
5181
5278
  // Add the remaining (directly-bound) handlers
5279
+ cur = this;
5182
5280
  if ( delegateCount < handlers.length ) {
5183
- handlerQueue.push( { elem: this, handlers: handlers.slice( delegateCount ) } );
5281
+ handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );
5184
5282
  }
5185
5283
 
5186
5284
  return handlerQueue;
@@ -5414,7 +5512,19 @@ jQuery.each( {
5414
5512
 
5415
5513
  // Add which for click: 1 === left; 2 === middle; 3 === right
5416
5514
  if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) {
5417
- return ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
5515
+ if ( button & 1 ) {
5516
+ return 1;
5517
+ }
5518
+
5519
+ if ( button & 2 ) {
5520
+ return 3;
5521
+ }
5522
+
5523
+ if ( button & 4 ) {
5524
+ return 2;
5525
+ }
5526
+
5527
+ return 0;
5418
5528
  }
5419
5529
 
5420
5530
  return event.which;
@@ -6170,15 +6280,17 @@ function setPositiveNumber( elem, value, subtract ) {
6170
6280
  }
6171
6281
 
6172
6282
  function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
6173
- var i = extra === ( isBorderBox ? "border" : "content" ) ?
6174
-
6175
- // If we already have the right measurement, avoid augmentation
6176
- 4 :
6283
+ var i,
6284
+ val = 0;
6177
6285
 
6178
- // Otherwise initialize for horizontal or vertical properties
6179
- name === "width" ? 1 : 0,
6286
+ // If we already have the right measurement, avoid augmentation
6287
+ if ( extra === ( isBorderBox ? "border" : "content" ) ) {
6288
+ i = 4;
6180
6289
 
6181
- val = 0;
6290
+ // Otherwise initialize for horizontal or vertical properties
6291
+ } else {
6292
+ i = name === "width" ? 1 : 0;
6293
+ }
6182
6294
 
6183
6295
  for ( ; i < 4; i += 2 ) {
6184
6296
 
@@ -7032,7 +7144,7 @@ jQuery.Animation = jQuery.extend( Animation, {
7032
7144
  callback = props;
7033
7145
  props = [ "*" ];
7034
7146
  } else {
7035
- props = props.match( rnotwhite );
7147
+ props = props.match( rnothtmlwhite );
7036
7148
  }
7037
7149
 
7038
7150
  var prop,
@@ -7070,9 +7182,14 @@ jQuery.speed = function( speed, easing, fn ) {
7070
7182
  opt.duration = 0;
7071
7183
 
7072
7184
  } else {
7073
- opt.duration = typeof opt.duration === "number" ?
7074
- opt.duration : opt.duration in jQuery.fx.speeds ?
7075
- jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
7185
+ if ( typeof opt.duration !== "number" ) {
7186
+ if ( opt.duration in jQuery.fx.speeds ) {
7187
+ opt.duration = jQuery.fx.speeds[ opt.duration ];
7188
+
7189
+ } else {
7190
+ opt.duration = jQuery.fx.speeds._default;
7191
+ }
7192
+ }
7076
7193
  }
7077
7194
 
7078
7195
  // Normalize opt.queue - true/undefined/null -> "fx"
@@ -7422,7 +7539,10 @@ jQuery.extend( {
7422
7539
  removeAttr: function( elem, value ) {
7423
7540
  var name,
7424
7541
  i = 0,
7425
- attrNames = value && value.match( rnotwhite );
7542
+
7543
+ // Attribute names can contain non-HTML whitespace characters
7544
+ // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
7545
+ attrNames = value && value.match( rnothtmlwhite );
7426
7546
 
7427
7547
  if ( attrNames && elem.nodeType === 1 ) {
7428
7548
  while ( ( name = attrNames[ i++ ] ) ) {
@@ -7529,12 +7649,19 @@ jQuery.extend( {
7529
7649
  // Use proper attribute retrieval(#12072)
7530
7650
  var tabindex = jQuery.find.attr( elem, "tabindex" );
7531
7651
 
7532
- return tabindex ?
7533
- parseInt( tabindex, 10 ) :
7652
+ if ( tabindex ) {
7653
+ return parseInt( tabindex, 10 );
7654
+ }
7655
+
7656
+ if (
7534
7657
  rfocusable.test( elem.nodeName ) ||
7535
- rclickable.test( elem.nodeName ) && elem.href ?
7536
- 0 :
7537
- -1;
7658
+ rclickable.test( elem.nodeName ) &&
7659
+ elem.href
7660
+ ) {
7661
+ return 0;
7662
+ }
7663
+
7664
+ return -1;
7538
7665
  }
7539
7666
  }
7540
7667
  },
@@ -7551,9 +7678,14 @@ jQuery.extend( {
7551
7678
  // on the option
7552
7679
  // The getter ensures a default option is selected
7553
7680
  // when in an optgroup
7681
+ // eslint rule "no-unused-expressions" is disabled for this code
7682
+ // since it considers such accessions noop
7554
7683
  if ( !support.optSelected ) {
7555
7684
  jQuery.propHooks.selected = {
7556
7685
  get: function( elem ) {
7686
+
7687
+ /* eslint no-unused-expressions: "off" */
7688
+
7557
7689
  var parent = elem.parentNode;
7558
7690
  if ( parent && parent.parentNode ) {
7559
7691
  parent.parentNode.selectedIndex;
@@ -7561,6 +7693,9 @@ if ( !support.optSelected ) {
7561
7693
  return null;
7562
7694
  },
7563
7695
  set: function( elem ) {
7696
+
7697
+ /* eslint no-unused-expressions: "off" */
7698
+
7564
7699
  var parent = elem.parentNode;
7565
7700
  if ( parent ) {
7566
7701
  parent.selectedIndex;
@@ -7591,7 +7726,13 @@ jQuery.each( [
7591
7726
 
7592
7727
 
7593
7728
 
7594
- var rclass = /[\t\r\n\f]/g;
7729
+ // Strip and collapse whitespace according to HTML spec
7730
+ // https://html.spec.whatwg.org/multipage/infrastructure.html#strip-and-collapse-whitespace
7731
+ function stripAndCollapse( value ) {
7732
+ var tokens = value.match( rnothtmlwhite ) || [];
7733
+ return tokens.join( " " );
7734
+ }
7735
+
7595
7736
 
7596
7737
  function getClass( elem ) {
7597
7738
  return elem.getAttribute && elem.getAttribute( "class" ) || "";
@@ -7609,12 +7750,11 @@ jQuery.fn.extend( {
7609
7750
  }
7610
7751
 
7611
7752
  if ( typeof value === "string" && value ) {
7612
- classes = value.match( rnotwhite ) || [];
7753
+ classes = value.match( rnothtmlwhite ) || [];
7613
7754
 
7614
7755
  while ( ( elem = this[ i++ ] ) ) {
7615
7756
  curValue = getClass( elem );
7616
- cur = elem.nodeType === 1 &&
7617
- ( " " + curValue + " " ).replace( rclass, " " );
7757
+ cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
7618
7758
 
7619
7759
  if ( cur ) {
7620
7760
  j = 0;
@@ -7625,7 +7765,7 @@ jQuery.fn.extend( {
7625
7765
  }
7626
7766
 
7627
7767
  // Only assign if different to avoid unneeded rendering.
7628
- finalValue = jQuery.trim( cur );
7768
+ finalValue = stripAndCollapse( cur );
7629
7769
  if ( curValue !== finalValue ) {
7630
7770
  elem.setAttribute( "class", finalValue );
7631
7771
  }
@@ -7651,14 +7791,13 @@ jQuery.fn.extend( {
7651
7791
  }
7652
7792
 
7653
7793
  if ( typeof value === "string" && value ) {
7654
- classes = value.match( rnotwhite ) || [];
7794
+ classes = value.match( rnothtmlwhite ) || [];
7655
7795
 
7656
7796
  while ( ( elem = this[ i++ ] ) ) {
7657
7797
  curValue = getClass( elem );
7658
7798
 
7659
7799
  // This expression is here for better compressibility (see addClass)
7660
- cur = elem.nodeType === 1 &&
7661
- ( " " + curValue + " " ).replace( rclass, " " );
7800
+ cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
7662
7801
 
7663
7802
  if ( cur ) {
7664
7803
  j = 0;
@@ -7671,7 +7810,7 @@ jQuery.fn.extend( {
7671
7810
  }
7672
7811
 
7673
7812
  // Only assign if different to avoid unneeded rendering.
7674
- finalValue = jQuery.trim( cur );
7813
+ finalValue = stripAndCollapse( cur );
7675
7814
  if ( curValue !== finalValue ) {
7676
7815
  elem.setAttribute( "class", finalValue );
7677
7816
  }
@@ -7706,7 +7845,7 @@ jQuery.fn.extend( {
7706
7845
  // Toggle individual class names
7707
7846
  i = 0;
7708
7847
  self = jQuery( this );
7709
- classNames = value.match( rnotwhite ) || [];
7848
+ classNames = value.match( rnothtmlwhite ) || [];
7710
7849
 
7711
7850
  while ( ( className = classNames[ i++ ] ) ) {
7712
7851
 
@@ -7749,10 +7888,8 @@ jQuery.fn.extend( {
7749
7888
  className = " " + selector + " ";
7750
7889
  while ( ( elem = this[ i++ ] ) ) {
7751
7890
  if ( elem.nodeType === 1 &&
7752
- ( " " + getClass( elem ) + " " ).replace( rclass, " " )
7753
- .indexOf( className ) > -1
7754
- ) {
7755
- return true;
7891
+ ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {
7892
+ return true;
7756
7893
  }
7757
7894
  }
7758
7895
 
@@ -7763,8 +7900,7 @@ jQuery.fn.extend( {
7763
7900
 
7764
7901
 
7765
7902
 
7766
- var rreturn = /\r/g,
7767
- rspaces = /[\x20\t\r\n\f]+/g;
7903
+ var rreturn = /\r/g;
7768
7904
 
7769
7905
  jQuery.fn.extend( {
7770
7906
  val: function( value ) {
@@ -7785,13 +7921,13 @@ jQuery.fn.extend( {
7785
7921
 
7786
7922
  ret = elem.value;
7787
7923
 
7788
- return typeof ret === "string" ?
7789
-
7790
- // Handle most common string cases
7791
- ret.replace( rreturn, "" ) :
7924
+ // Handle most common string cases
7925
+ if ( typeof ret === "string" ) {
7926
+ return ret.replace( rreturn, "" );
7927
+ }
7792
7928
 
7793
- // Handle cases where value is null/undef or number
7794
- ret == null ? "" : ret;
7929
+ // Handle cases where value is null/undef or number
7930
+ return ret == null ? "" : ret;
7795
7931
  }
7796
7932
 
7797
7933
  return;
@@ -7848,20 +7984,24 @@ jQuery.extend( {
7848
7984
  // option.text throws exceptions (#14686, #14858)
7849
7985
  // Strip and collapse whitespace
7850
7986
  // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
7851
- jQuery.trim( jQuery.text( elem ) ).replace( rspaces, " " );
7987
+ stripAndCollapse( jQuery.text( elem ) );
7852
7988
  }
7853
7989
  },
7854
7990
  select: {
7855
7991
  get: function( elem ) {
7856
- var value, option,
7992
+ var value, option, i,
7857
7993
  options = elem.options,
7858
7994
  index = elem.selectedIndex,
7859
7995
  one = elem.type === "select-one",
7860
7996
  values = one ? null : [],
7861
- max = one ? index + 1 : options.length,
7862
- i = index < 0 ?
7863
- max :
7864
- one ? index : 0;
7997
+ max = one ? index + 1 : options.length;
7998
+
7999
+ if ( index < 0 ) {
8000
+ i = max;
8001
+
8002
+ } else {
8003
+ i = one ? index : 0;
8004
+ }
7865
8005
 
7866
8006
  // Loop through all the selected options
7867
8007
  for ( ; i < max; i++ ) {
@@ -8315,13 +8455,17 @@ jQuery.fn.extend( {
8315
8455
  .map( function( i, elem ) {
8316
8456
  var val = jQuery( this ).val();
8317
8457
 
8318
- return val == null ?
8319
- null :
8320
- jQuery.isArray( val ) ?
8321
- jQuery.map( val, function( val ) {
8322
- return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
8323
- } ) :
8324
- { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
8458
+ if ( val == null ) {
8459
+ return null;
8460
+ }
8461
+
8462
+ if ( jQuery.isArray( val ) ) {
8463
+ return jQuery.map( val, function( val ) {
8464
+ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
8465
+ } );
8466
+ }
8467
+
8468
+ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
8325
8469
  } ).get();
8326
8470
  }
8327
8471
  } );
@@ -8330,7 +8474,7 @@ jQuery.fn.extend( {
8330
8474
  var
8331
8475
  r20 = /%20/g,
8332
8476
  rhash = /#.*$/,
8333
- rts = /([?&])_=[^&]*/,
8477
+ rantiCache = /([?&])_=[^&]*/,
8334
8478
  rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
8335
8479
 
8336
8480
  // #7653, #8125, #8152: local protocol detection
@@ -8376,7 +8520,7 @@ function addToPrefiltersOrTransports( structure ) {
8376
8520
 
8377
8521
  var dataType,
8378
8522
  i = 0,
8379
- dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];
8523
+ dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];
8380
8524
 
8381
8525
  if ( jQuery.isFunction( func ) ) {
8382
8526
 
@@ -8844,7 +8988,7 @@ jQuery.extend( {
8844
8988
  s.type = options.method || options.type || s.method || s.type;
8845
8989
 
8846
8990
  // Extract dataTypes list
8847
- s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
8991
+ s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ];
8848
8992
 
8849
8993
  // A cross-domain request is in order when the origin doesn't match the current origin.
8850
8994
  if ( s.crossDomain == null ) {
@@ -8916,9 +9060,9 @@ jQuery.extend( {
8916
9060
  delete s.data;
8917
9061
  }
8918
9062
 
8919
- // Add anti-cache in uncached url if needed
9063
+ // Add or update anti-cache param if needed
8920
9064
  if ( s.cache === false ) {
8921
- cacheURL = cacheURL.replace( rts, "" );
9065
+ cacheURL = cacheURL.replace( rantiCache, "$1" );
8922
9066
  uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached;
8923
9067
  }
8924
9068
 
@@ -9657,7 +9801,7 @@ jQuery.fn.load = function( url, params, callback ) {
9657
9801
  off = url.indexOf( " " );
9658
9802
 
9659
9803
  if ( off > -1 ) {
9660
- selector = jQuery.trim( url.slice( off ) );
9804
+ selector = stripAndCollapse( url.slice( off ) );
9661
9805
  url = url.slice( 0, off );
9662
9806
  }
9663
9807
 
@@ -10049,7 +10193,6 @@ if ( typeof define === "function" && define.amd ) {
10049
10193
 
10050
10194
 
10051
10195
 
10052
-
10053
10196
  var
10054
10197
 
10055
10198
  // Map over jQuery in case of overwrite
@@ -10078,6 +10221,9 @@ if ( !noGlobal ) {
10078
10221
  }
10079
10222
 
10080
10223
 
10224
+
10225
+
10226
+
10081
10227
  return jQuery;
10082
10228
  } );
10083
10229
  (function($, undefined) {
@@ -30798,27 +30944,41 @@ var Deferred = void 0;
30798
30944
  }).call(this);
30799
30945
  (function() {
30800
30946
  var TaoComponentBasedOn, components,
30801
- extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
30802
- hasProp = {}.hasOwnProperty,
30803
30947
  slice = [].slice;
30804
30948
 
30805
30949
  components = {};
30806
30950
 
30807
- TaoComponentBasedOn = function(superClass) {
30808
- if (superClass == null) {
30809
- superClass = 'HTMLElement';
30951
+ TaoComponentBasedOn = function(superClassName) {
30952
+ var ComponentClass;
30953
+ if (superClassName == null) {
30954
+ superClassName = 'HTMLElement';
30810
30955
  }
30811
- if (components[superClass]) {
30812
- return components[superClass];
30956
+ if (components[superClassName]) {
30957
+ return components[superClassName];
30813
30958
  }
30814
- return components[superClass] = (function(superClass1) {
30815
- var count;
30959
+ ComponentClass = (function() {
30960
+ var count, superClass;
30961
+
30962
+ superClass = window[superClassName];
30963
+
30964
+ ComponentClass.prototype = Object.create(superClass.prototype, {
30965
+ constructor: {
30966
+ value: ComponentClass,
30967
+ enumerable: false,
30968
+ writable: true,
30969
+ configurable: true
30970
+ }
30971
+ });
30816
30972
 
30817
- extend(_Class, superClass1);
30973
+ if (Object.setPrototypeOf != null) {
30974
+ Object.setPrototypeOf(ComponentClass, superClass);
30975
+ } else {
30976
+ ComponentClass.__proto__ = superClass;
30977
+ }
30818
30978
 
30819
30979
  count = 0;
30820
30980
 
30821
- _Class.extend = function(obj) {
30981
+ ComponentClass.extend = function(obj) {
30822
30982
  var key, ref, val;
30823
30983
  if (!(obj && typeof obj === 'object')) {
30824
30984
  throw new Error('TaoComponent.extend: param should be an object');
@@ -30835,7 +30995,7 @@ var Deferred = void 0;
30835
30995
  return this;
30836
30996
  };
30837
30997
 
30838
- _Class.include = function(obj) {
30998
+ ComponentClass.include = function(obj) {
30839
30999
  var key, ref, val;
30840
31000
  if (!(obj && typeof obj === 'object')) {
30841
31001
  throw new Error('TaoComponent.include: param should be an object');
@@ -30852,21 +31012,21 @@ var Deferred = void 0;
30852
31012
  return this;
30853
31013
  };
30854
31014
 
30855
- _Class.get = function(attributeName, getMethod) {
31015
+ ComponentClass.get = function(attributeName, getMethod) {
30856
31016
  return Object.defineProperty(this.prototype, attributeName, {
30857
31017
  get: getMethod,
30858
31018
  configurable: true
30859
31019
  });
30860
31020
  };
30861
31021
 
30862
- _Class.set = function(attributeName, setMethod) {
31022
+ ComponentClass.set = function(attributeName, setMethod) {
30863
31023
  return Object.defineProperty(this.prototype, attributeName, {
30864
31024
  set: setMethod,
30865
31025
  configurable: true
30866
31026
  });
30867
31027
  };
30868
31028
 
30869
- _Class.attribute = function() {
31029
+ ComponentClass.attribute = function() {
30870
31030
  var i, names, options;
30871
31031
  names = 2 <= arguments.length ? slice.call(arguments, 0, i = arguments.length - 1) : (i = 0, []), options = arguments[i++];
30872
31032
  if (options == null) {
@@ -30913,31 +31073,29 @@ var Deferred = void 0;
30913
31073
  })(this));
30914
31074
  };
30915
31075
 
30916
- _Class.tag = '';
31076
+ ComponentClass.tag = '';
30917
31077
 
30918
- _Class.register = function(componentClass) {
31078
+ ComponentClass.register = function(componentClass) {
30919
31079
  if (!componentClass.tag) {
30920
31080
  return;
30921
31081
  }
30922
31082
  return customElements.define(componentClass.tag, componentClass);
30923
31083
  };
30924
31084
 
30925
- _Class.observedAttributes = [];
31085
+ ComponentClass.observedAttributes = [];
30926
31086
 
30927
- _Class.get('jq', function() {
31087
+ ComponentClass.get('jq', function() {
30928
31088
  return $(this);
30929
31089
  });
30930
31090
 
30931
- _Class.attribute('taoId');
31091
+ ComponentClass.attribute('taoId');
30932
31092
 
30933
- function _Class() {
30934
- var instance;
30935
- instance = window[superClass].apply(this, arguments);
31093
+ function ComponentClass() {
31094
+ superClass.apply(this, arguments);
30936
31095
  this._created();
30937
- instance;
30938
31096
  }
30939
31097
 
30940
- _Class.prototype.connectedCallback = function() {
31098
+ ComponentClass.prototype.connectedCallback = function() {
30941
31099
  return $((function(_this) {
30942
31100
  return function() {
30943
31101
  if (!_this.initialized) {
@@ -30951,7 +31109,7 @@ var Deferred = void 0;
30951
31109
  })(this));
30952
31110
  };
30953
31111
 
30954
- _Class.prototype.disconnectedCallback = function() {
31112
+ ComponentClass.prototype.disconnectedCallback = function() {
30955
31113
  return $((function(_this) {
30956
31114
  return function() {
30957
31115
  _this.connected = false;
@@ -30960,52 +31118,53 @@ var Deferred = void 0;
30960
31118
  })(this));
30961
31119
  };
30962
31120
 
30963
- _Class.prototype.attributeChangedCallback = function(name) {
31121
+ ComponentClass.prototype.attributeChangedCallback = function(name) {
30964
31122
  return this._attributeChanged(name);
30965
31123
  };
30966
31124
 
30967
- _Class.prototype._created = function() {};
31125
+ ComponentClass.prototype._created = function() {};
30968
31126
 
30969
- _Class.prototype._init = function() {};
31127
+ ComponentClass.prototype._init = function() {};
30970
31128
 
30971
- _Class.prototype._connected = function() {};
31129
+ ComponentClass.prototype._connected = function() {};
30972
31130
 
30973
- _Class.prototype._disconnected = function() {};
31131
+ ComponentClass.prototype._disconnected = function() {};
30974
31132
 
30975
- _Class.prototype._attributeChanged = function(name) {
31133
+ ComponentClass.prototype._attributeChanged = function(name) {
30976
31134
  var name1;
30977
31135
  return typeof this[name1 = "_" + (_.camelCase(name)) + "Changed"] === "function" ? this[name1]() : void 0;
30978
31136
  };
30979
31137
 
30980
- _Class.prototype.beforeCache = function() {};
31138
+ ComponentClass.prototype.beforeCache = function() {};
30981
31139
 
30982
- _Class.prototype.on = function() {
31140
+ ComponentClass.prototype.on = function() {
30983
31141
  var args, ref;
30984
31142
  args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
30985
31143
  return (ref = this.jq).on.apply(ref, args);
30986
31144
  };
30987
31145
 
30988
- _Class.prototype.off = function() {
31146
+ ComponentClass.prototype.off = function() {
30989
31147
  var args, ref;
30990
31148
  args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
30991
31149
  return (ref = this.jq).off.apply(ref, args);
30992
31150
  };
30993
31151
 
30994
- _Class.prototype.trigger = function() {
31152
+ ComponentClass.prototype.trigger = function() {
30995
31153
  var args, ref;
30996
31154
  args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
30997
31155
  return (ref = this.jq).triggerHandler.apply(ref, args);
30998
31156
  };
30999
31157
 
31000
- _Class.prototype.one = function() {
31158
+ ComponentClass.prototype.one = function() {
31001
31159
  var args, ref;
31002
31160
  args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
31003
31161
  return (ref = this.jq).one.apply(ref, args);
31004
31162
  };
31005
31163
 
31006
- return _Class;
31164
+ return ComponentClass;
31007
31165
 
31008
- })(window[superClass]);
31166
+ })();
31167
+ return components[superClassName] = ComponentClass;
31009
31168
  };
31010
31169
 
31011
31170
  window.TaoComponentBasedOn = TaoComponentBasedOn;
@@ -3,10 +3,26 @@
3
3
 
4
4
  components = {}
5
5
 
6
- TaoComponentBasedOn = (superClass = 'HTMLElement') ->
7
- return components[superClass] if components[superClass]
6
+ TaoComponentBasedOn = (superClassName = 'HTMLElement') ->
7
+ return components[superClassName] if components[superClassName]
8
+
9
+ class ComponentClass
10
+
11
+ # coffee's inheritance code is not compatible with custom elements
12
+ superClass = window[superClassName]
13
+
14
+ @prototype = Object.create superClass.prototype,
15
+ constructor:
16
+ value: @
17
+ enumerable: false
18
+ writable: true
19
+ configurable: true
20
+
21
+ if Object.setPrototypeOf?
22
+ Object.setPrototypeOf @, superClass
23
+ else
24
+ @__proto__ = superClass
8
25
 
9
- class components[superClass] extends window[superClass]
10
26
 
11
27
  count = 0
12
28
 
@@ -80,9 +96,8 @@ TaoComponentBasedOn = (superClass = 'HTMLElement') ->
80
96
  @attribute 'taoId'
81
97
 
82
98
  constructor: ->
83
- instance = window[superClass].apply(@, arguments)
99
+ superClass.apply @, arguments
84
100
  @_created()
85
- instance
86
101
 
87
102
  connectedCallback: ->
88
103
  $ =>
@@ -132,6 +147,7 @@ TaoComponentBasedOn = (superClass = 'HTMLElement') ->
132
147
  one: (args...) ->
133
148
  @jq.one args...
134
149
 
150
+ components[superClassName] = ComponentClass
135
151
 
136
152
  window.TaoComponentBasedOn = TaoComponentBasedOn
137
153
  window.TaoComponent = TaoComponentBasedOn 'HTMLElement'
@@ -1,5 +1,5 @@
1
1
  module TaoOnRails
2
2
  module Rails
3
- VERSION = "0.6.0"
3
+ VERSION = "0.6.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tao_on_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Siyuan Liu