From e99aefb50ca63e2dbcc95841efbb53cea90151d8 Mon Sep 17 00:00:00 2001 From: Tim Baumann Date: Sat, 23 Sep 2017 22:02:01 +0200 Subject: Add compile step that bundles and compresses JS files (#684) * Add compile step that bundles and compresses JS files Also, manage dependencies on third-party JS libraries using NPM. * Compile JS from TypeScript * Enable 'noImplicitAny' in TypeScript * QuickJump: use JSX syntax * Generate source maps from TypeScript for easier debugging * TypeScript: more accurate type * Separate quick jump css file from ocean theme --- haddock-api/resources/html/quick-jump.min.js | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 haddock-api/resources/html/quick-jump.min.js (limited to 'haddock-api/resources/html/quick-jump.min.js') diff --git a/haddock-api/resources/html/quick-jump.min.js b/haddock-api/resources/html/quick-jump.min.js new file mode 100644 index 00000000..c9f2b445 --- /dev/null +++ b/haddock-api/resources/html/quick-jump.min.js @@ -0,0 +1,2 @@ +!function t(e,n,o){function r(s,a){if(!n[s]){if(!e[s]){var l="function"==typeof require&&require;if(!a&&l)return l(s,!0);if(i)return i(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[s]={exports:{}};e[s][0].call(u.exports,function(t){var n=e[s][1][t];return r(n||t)},u,u.exports,t,e,n,o)}return n[s].exports}for(var i="function"==typeof require&&require,s=0;s=0&&t.followActiveLink()),"s"===e.key&&"input"!==e.target.tagName.toLowerCase()&&(e.preventDefault(),t.show())})},e.prototype.hide=function(){this.setState({isVisible:!1})},e.prototype.show=function(){this.state.isVisible||(this.focusPlease=!0,this.setState({isVisible:!0,activeLinkIndex:-1}))},e.prototype.toggleVisibility=function(){this.state.isVisible?this.hide():this.show()},e.prototype.navigateLinks=function(t){var e=Math.max(-1,Math.min(this.linkIndex-1,this.state.activeLinkIndex+t));this.navigatedByKeyboard=!0,this.setState({activeLinkIndex:e})},e.prototype.followActiveLink=function(){this.activeLinkAction&&this.activeLinkAction()},e.prototype.updateResults=function(){var t=this.input&&this.input.value||"",e={};this.state.fuse.search(t).forEach(function(t){var n=t.item.module;(e[n]||(e[n]=[])).push(t)});var n=[];for(var o in e)!function(t){var o=e[t],r=0;o.forEach(function(t){r+=1/t.score}),n.push({module:t,totalScore:1/r,items:o})}(o);n.sort(function(t,e){return t.totalScore-e.totalScore}),this.setState({searchString:t,isVisible:!0,moduleResults:n})},e.prototype.componentDidUpdate=function(){if(this.searchResults&&this.activeLink&&this.navigatedByKeyboard){var t=this.activeLink.getClientRects()[0],e=this.searchResults.getClientRects()[0].top;t.bottom>window.innerHeight?this.searchResults.scrollTop+=t.bottom-window.innerHeight+80:t.topn)return i(t,this.pattern,o);var r=this.options,a=r.location,l=r.distance,c=r.threshold,u=r.findAllMatches,h=r.minMatchCharLength;return s(t,this.pattern,this.patternAlphabet,{location:a,distance:l,threshold:c,findAllMatches:u,minMatchCharLength:h})}}]),t}();t.exports=l},function(t,e,n){"use strict";var o=n(0),r=function t(e,n,r){if(n){var i=n.indexOf("."),s=n,a=null;-1!==i&&(s=n.slice(0,i),a=n.slice(i+1));var l=e[s];if(null!==l&&void 0!==l)if(a||"string"!=typeof l&&"number"!=typeof l)if(o(l))for(var c=0,u=l.length;c0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=[],o=-1,r=-1,i=0,s=t.length;i=e&&n.push([o,r]),o=-1)}return t[i-1]&&i-o>=e&&n.push([o,i-1]),n}},function(t,e,n){"use strict";t.exports=function(t){for(var e={},n=t.length,o=0;o2&&void 0!==arguments[2]?arguments[2]:/ +/g,r=new RegExp(e.replace(o,"\\$&").replace(n,"|")),i=t.match(r),s=!!i,a=[];if(s)for(var l=0,c=i.length;l=T;E-=1){var R=E-1,U=n[t.charAt(R)];if(U&&(b[R]=1),j[E]=(j[E+1]<<1|1)&U,0!==I&&(j[E]|=(L[E+1]|L[E])<<1|1|L[E+1]),j[E]&N&&(C=o(e,{errors:I,currentLocation:R,expectedLocation:_,distance:c}))<=m){if(m=C,(y=R)<=_)break;T=Math.max(1,2*_-y)}}if(o(e,{errors:I+1,currentLocation:_,expectedLocation:_,distance:c})>m)break;L=j}return{isMatch:y>=0,score:0===C?.001:C,matchedIndices:r(b,v)}}},function(t,e,n){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var r=function(){function t(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"",e=[];if(this.options.tokenize)for(var n=t.split(this.options.tokenSeparator),o=0,r=n.length;o0&&void 0!==arguments[0]?arguments[0]:[],e=arguments[1],n=this.list,o={},r=[];if("string"==typeof n[0]){for(var i=0,s=n.length;i1)throw new Error("Key weight has to be > 0 and <= 1");f=f.name}else a[f]={weight:1};this._analyze({key:f,value:this.options.getFn(u,f),record:u,index:l},{resultMap:o,results:r,tokenSearchers:t,fullSearcher:e})}return{weights:a,results:r}}},{key:"_analyze",value:function(t,e){var n=t.key,o=t.arrayIndex,r=void 0===o?-1:o,i=t.value,s=t.record,l=t.index,c=e.tokenSearchers,u=void 0===c?[]:c,h=e.fullSearcher,p=void 0===h?[]:h,f=e.resultMap,d=void 0===f?{}:f,v=e.results,_=void 0===v?[]:v;if(void 0!==i&&null!==i){var g=!1,m=-1,y=0;if("string"==typeof i){this._log("\nKey: "+(""===n?"-":n));var k=p.search(i);if(this._log('Full text: "'+i+'", score: '+k.score),this.options.tokenize){for(var b=i.split(this.options.tokenSeparator),x=[],S=0;S-1&&(T=(T+m)/2),this._log("Score average:",T);var P=!this.options.tokenize||!this.options.matchAllTokens||y>=u.length;if(this._log("\nCheck Matches: "+P),(g||k.isMatch)&&P){var j=d[l];j?j.output.push({key:n,arrayIndex:r,value:i,score:T,matchedIndices:k.matchedIndices}):(d[l]={item:s,output:[{key:n,arrayIndex:r,value:i,score:T,matchedIndices:k.matchedIndices}]},_.push(d[l]))}}else if(a(i))for(var E=0,R=i.length;E-1&&(s.arrayIndex=i.arrayIndex),e.matches.push(s)}}}),this.options.includeScore&&n.push(function(t,e){e.score=t.score});for(var o=0,r=t.length;o2;)A.push(arguments[s]);for(n&&null!=n.children&&(A.length||A.push(n.children),delete n.children);A.length;)if((r=A.pop())&&void 0!==r.pop)for(s=r.length;s--;)A.push(r[s]);else"boolean"==typeof r&&(r=null),(i="function"!=typeof e)&&(null==r?r="":"number"==typeof r?r=String(r):"string"!=typeof r&&(i=!1)),i&&o?a[a.length-1]+=r:a===O?a=[r]:a.push(r),o=i;var l=new t;return l.nodeName=e,l.children=a,l.attributes=null==n?void 0:n,l.key=null==n?void 0:n.key,void 0!==I.vnode&&I.vnode(l),l}function o(t,e){for(var n in e)t[n]=e[n];return t}function r(t){!t.__d&&(t.__d=!0)&&1==j.push(t)&&(I.debounceRendering||T)(i)}function i(){var t,e=j;for(j=[];t=e.pop();)t.__d&&L(t)}function s(t,e,n){return"string"==typeof e||"number"==typeof e?void 0!==t.splitText:"string"==typeof e.nodeName?!t._componentConstructor&&a(t,e.nodeName):n||t._componentConstructor===e.nodeName}function a(t,e){return t.__n===e||t.nodeName.toLowerCase()===e.toLowerCase()}function l(t){var e=o({},t.attributes);e.children=t.children;var n=t.nodeName.defaultProps;if(void 0!==n)for(var r in n)void 0===e[r]&&(e[r]=n[r]);return e}function c(t,e){var n=e?document.createElementNS("http://www.w3.org/2000/svg",t):document.createElement(t);return n.__n=t,n}function u(t){var e=t.parentNode;e&&e.removeChild(t)}function h(t,e,n,o,r){if("className"===e&&(e="class"),"key"===e);else if("ref"===e)n&&n(null),o&&o(t);else if("class"!==e||r)if("style"===e){if(o&&"string"!=typeof o&&"string"!=typeof n||(t.style.cssText=o||""),o&&"object"==typeof o){if("string"!=typeof n)for(var i in n)i in o||(t.style[i]="");for(var i in o)t.style[i]="number"==typeof o[i]&&!1===P.test(i)?o[i]+"px":o[i]}}else if("dangerouslySetInnerHTML"===e)o&&(t.innerHTML=o.__html||"");else if("o"==e[0]&&"n"==e[1]){var s=e!==(e=e.replace(/Capture$/,""));e=e.toLowerCase().substring(2),o?n||t.addEventListener(e,f,s):t.removeEventListener(e,f,s),(t.__l||(t.__l={}))[e]=o}else if("list"!==e&&"type"!==e&&!r&&e in t)p(t,e,null==o?"":o),null!=o&&!1!==o||t.removeAttribute(e);else{var a=r&&e!==(e=e.replace(/^xlink\:?/,""));null==o||!1===o?a?t.removeAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase()):t.removeAttribute(e):"function"!=typeof o&&(a?t.setAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase(),o):t.setAttribute(e,o))}else t.className=o||""}function p(t,e,n){try{t[e]=n}catch(t){}}function f(t){return this.__l[t.type](I.event&&I.event(t)||t)}function d(){for(var t;t=E.pop();)I.afterMount&&I.afterMount(t),t.componentDidMount&&t.componentDidMount()}function v(t,e,n,o,r,i){R++||(U=null!=r&&void 0!==r.ownerSVGElement,D=null!=t&&!("__preactattr_"in t));var s=_(t,e,n,o,i);return r&&s.parentNode!==r&&r.appendChild(s),--R||(D=!1,i||d()),s}function _(t,e,n,o,r){var i=t,s=U;if(null!=e&&"boolean"!=typeof e||(e=""),"string"==typeof e||"number"==typeof e)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||r)?t.nodeValue!=e&&(t.nodeValue=e):(i=document.createTextNode(e),t&&(t.parentNode&&t.parentNode.replaceChild(i,t),m(t,!0))),i.__preactattr_=!0,i;var l=e.nodeName;if("function"==typeof l)return C(t,e,n,o);if(U="svg"===l||"foreignObject"!==l&&U,l=String(l),(!t||!a(t,l))&&(i=c(l,U),t)){for(;t.firstChild;)i.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(i,t),m(t,!0)}var u=i.firstChild,h=i.__preactattr_,p=e.children;if(null==h){h=i.__preactattr_={};for(var f=i.attributes,d=f.length;d--;)h[f[d].name]=f[d].value}return!D&&p&&1===p.length&&"string"==typeof p[0]&&null!=u&&void 0!==u.splitText&&null==u.nextSibling?u.nodeValue!=p[0]&&(u.nodeValue=p[0]):(p&&p.length||null!=u)&&g(i,p,n,o,D||null!=h.dangerouslySetInnerHTML),k(i,e.attributes,h),U=s,i}function g(t,e,n,o,r){var i,a,l,c,h,p=t.childNodes,f=[],d={},v=0,g=0,y=p.length,k=0,b=e?e.length:0;if(0!==y)for(L=0;L2?[].slice.call(arguments,2):t.children)},Component:N,render:function(t,e,n){return v(n,t,{},!1,e,!1)},rerender:i,options:I};void 0!==e?e.exports=F:self.preact=F}()},{}]},{},[1]); +//# sourceMappingURL=quick-jump.min.js.map -- cgit v1.2.3