diff --git a/resources/js/vendor/jekyll.search.min.js b/resources/js/vendor/jekyll.search.min.js index 741a70f1f..dd4b00082 100644 --- a/resources/js/vendor/jekyll.search.min.js +++ b/resources/js/vendor/jekyll.search.min.js @@ -1 +1,6 @@ -(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;otlen){return false}if(qlen===tlen){return needle===haystack}outer:for(var i=0,j=0;i=0}}},{}],7:[function(require,module,exports){"use strict";module.exports={compile:compile,setOptions:setOptions};var options={};options.pattern=/\{(.*?)\}/g;options.template="";options.middleware=function(){};function setOptions(_options){options.pattern=_options.pattern||options.pattern;options.template=_options.template||options.template;if(typeof _options.middleware==="function"){options.middleware=_options.middleware}}function compile(data){return options.template.replace(options.pattern,function(match,prop){var value=options.middleware(prop,data[prop],options.template);if(value!==undefined){return value}return data[prop]||match})}},{}],8:[function(require,module,exports){(function(window,document,undefined){"use strict";var options={searchInput:null,resultsContainer:null,json:[],searchResultTemplate:'
  • {title}
  • ',templateMiddleware:function(){},noResultsText:"No results found",limit:99,fuzzy:false,exclude:[]};var requiredOptions=["searchInput","resultsContainer","json"];var templater=require("./Templater");var repository=require("./Repository");var jsonLoader=require("./JSONLoader");var optionsValidator=require("./OptionsValidator")({required:requiredOptions});var utils=require("./utils");window.SimpleJekyllSearch=function SimpleJekyllSearch(_options){var errors=optionsValidator.validate(_options);if(errors.length>0){throwError("You must specify the following required options: "+requiredOptions)}options=utils.merge(options,_options);templater.setOptions({template:options.searchResultTemplate,middleware:options.templateMiddleware});repository.setOptions({fuzzy:options.fuzzy,limit:options.limit});if(utils.isJSON(options.json)){initWithJSON(options.json)}else{initWithURL(options.json)}};window.SimpleJekyllSearch.init=window.SimpleJekyllSearch;if(typeof window.SimpleJekyllSearchInit==="function"){window.SimpleJekyllSearchInit.call(this,window.SimpleJekyllSearch)}function initWithJSON(json){repository.put(json);registerInput()}function initWithURL(url){jsonLoader.load(url,function(err,json){if(err){throwError("failed to get JSON ("+url+")")}initWithJSON(json)})}function emptyResultsContainer(){options.resultsContainer.innerHTML=""}function appendToResultsContainer(text){options.resultsContainer.innerHTML+=text}function registerInput(){options.searchInput.addEventListener("keyup",function(e){emptyResultsContainer();var key=e.which;var query=e.target.value;if(isWhitelistedKey(key)&&isValidQuery(query)){render(repository.search(query))}})}function render(results){if(results.length===0){return appendToResultsContainer(options.noResultsText)}for(var i=0;i0}function isWhitelistedKey(key){return[13,16,20,37,38,39,40,91].indexOf(key)===-1}function throwError(message){throw new Error("SimpleJekyllSearch --- "+message)}})(window,document)},{"./JSONLoader":2,"./OptionsValidator":3,"./Repository":4,"./Templater":7,"./utils":9}],9:[function(require,module,exports){"use strict";module.exports={merge:merge,isJSON:isJSON};function merge(defaultParams,mergeParams){var mergedOptions={};for(var option in defaultParams){mergedOptions[option]=defaultParams[option];if(mergeParams[option]!==undefined){mergedOptions[option]=mergeParams[option]}}return mergedOptions}function isJSON(json){try{if(json instanceof Object&&JSON.parse(JSON.stringify(json))){return true}return false}catch(e){return false}}},{}]},{},[8]); +/*! + * Simple-Jekyll-Search v1.6.3 (https://github.com/christian-fei/Simple-Jekyll-Search) + * Copyright 2015-2018, Christian Fei + * Licensed under the MIT License. + */ +!function(){"use strict";var s={load:function(e,t){var n=window.XMLHttpRequest?new window.XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");n.open("GET",e,!0),n.onreadystatechange=(r=n,i=t,function(){if(4===r.readyState&&200===r.status)try{i(null,JSON.parse(r.responseText))}catch(e){i(e,null)}}),n.send();var r,i}};var n=function(e,t){var n=t.length,r=e.length;if(n{title}',templateMiddleware:Function.prototype,sortMiddleware:function(){return 0},noResultsText:"No results found",limit:10,fuzzy:!1,exclude:[]},i=["searchInput","resultsContainer","json"],o=function e(t){if(n=t,!(n&&"undefined"!=typeof n.required&&n.required instanceof Array))throw new Error("-- OptionsValidator: required options missing");var n;if(!(this instanceof e))return new e(t);var r=t.required;this.getRequiredOptions=function(){return r},this.validate=function(t){var n=[];return r.forEach(function(e){"undefined"==typeof t[e]&&n.push(e)}),n}}({required:i});function a(e){r.success(e),f.put(e),r.searchInput.addEventListener("keyup",function(e){var t;t=e.which,-1===[13,16,20,37,38,39,40,91].indexOf(t)&&(n(),l(e.target.value))})}function n(){r.resultsContainer.innerHTML=""}function u(e){r.resultsContainer.innerHTML+=e}function l(e){var t;(t=e)&&0