algoliasearch-rails 1.11.17 → 1.11.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (26) hide show
  1. checksums.yaml +4 -4
  2. data/ChangeLog +4 -0
  3. data/README.md +48 -6
  4. data/VERSION +1 -1
  5. data/algoliasearch-rails.gemspec +22 -6
  6. data/vendor/assets/javascripts/algolia/algoliasearch.angular.js +1446 -1378
  7. data/vendor/assets/javascripts/algolia/algoliasearch.angular.min.js +2 -2
  8. data/vendor/assets/javascripts/algolia/algoliasearch.jquery.js +1446 -1378
  9. data/vendor/assets/javascripts/algolia/algoliasearch.jquery.min.js +2 -2
  10. data/vendor/assets/javascripts/algolia/algoliasearch.js +1446 -1378
  11. data/vendor/assets/javascripts/algolia/algoliasearch.min.js +2 -2
  12. data/vendor/assets/javascripts/algolia/bloodhound.min.js +7 -0
  13. data/vendor/assets/javascripts/algolia/typeahead.jquery.min.js +7 -0
  14. data/vendor/assets/javascripts/algolia/v2/algoliasearch.angular.js +2667 -0
  15. data/vendor/assets/javascripts/algolia/v2/algoliasearch.angular.min.js +7 -0
  16. data/vendor/assets/javascripts/algolia/v2/algoliasearch.jquery.js +2667 -0
  17. data/vendor/assets/javascripts/algolia/v2/algoliasearch.jquery.min.js +7 -0
  18. data/vendor/assets/javascripts/algolia/v2/algoliasearch.js +2653 -0
  19. data/vendor/assets/javascripts/algolia/v2/algoliasearch.min.js +7 -0
  20. data/vendor/assets/javascripts/algolia/v3/algoliasearch.angular.js +1717 -0
  21. data/vendor/assets/javascripts/algolia/v3/algoliasearch.angular.min.js +37 -0
  22. data/vendor/assets/javascripts/algolia/v3/algoliasearch.jquery.js +1702 -0
  23. data/vendor/assets/javascripts/algolia/v3/algoliasearch.jquery.min.js +37 -0
  24. data/vendor/assets/javascripts/algolia/v3/algoliasearch.js +2732 -0
  25. data/vendor/assets/javascripts/algolia/v3/algoliasearch.min.js +50 -0
  26. metadata +36 -22
@@ -0,0 +1,50 @@
1
+ /*! algoliasearch 3.0.3 | © 2014, 2015 Algolia SAS | github.com/algolia/algoliasearch-client-js */
2
+ (function(B){var e;"undefined"!==typeof window?e=window:"undefined"!==typeof self&&(e=self);e.ALGOLIA_MIGRATION_LAYER=B()})(function(){return function e(h,n,m){function g(a,b){if(!n[a]){if(!h[a]){var c="function"==typeof require&&require;if(!b&&c)return c(a,!0);if(l)return l(a,!0);c=Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c;}c=n[a]={exports:{}};h[a][0].call(c.exports,function(b){var c=h[a][1][b];return g(c?c:b)},c,c.exports,e,h,n,m)}return n[a].exports}for(var l="function"==
3
+ typeof require&&require,f=0;f<m.length;f++)g(m[f]);return g}({1:[function(e,h,n){function m(f,a){for(var b in a)f.setAttribute(b,a[b])}function g(f,a){f.onload=function(){this.onerror=this.onload=null;a(null,f)};f.onerror=function(){this.onerror=this.onload=null;a(Error("Failed to load "+this.src),f)}}function l(f,a){f.onreadystatechange=function(){if("complete"==this.readyState||"loaded"==this.readyState)this.onreadystatechange=null,a(null,f)}}h.exports=function(f,a,b){var c=document.head||document.getElementsByTagName("head")[0],
4
+ d=document.createElement("script");"function"===typeof a&&(b=a,a={});a=a||{};b=b||function(){};d.type=a.type||"text/javascript";d.charset=a.charset||"utf8";d.async="async"in a?!!a.async:!0;d.src=f;a.attrs&&m(d,a.attrs);a.text&&(d.text=""+a.text);("onload"in d?g:l)(d,b);d.onload||g(d,b);c.appendChild(d)}},{}],2:[function(e,h,n){h.exports=function(e){e=new RegExp("cdn\\.jsdelivr\\.net/algoliasearch/latest/"+e.replace(".","\\.")+"(?:\\.min)?\\.js$");for(var g=document.getElementsByTagName("script"),
5
+ l=!1,f=0,a=g.length;f<a;f++)if(g[f].src&&e.test(g[f].src)){l=!0;break}return l}},{}],3:[function(e,h,n){(function(m){function g(e){return function(){var f="AlgoliaSearch: loaded V2 script using "+e;m.console&&m.console.log&&m.console.log(f)}}h.exports=function(l){var f=e(1);l="//cdn.jsdelivr.net/algoliasearch/2/"+l+".min.js";m.console&&(m.console.warn?m.console.warn("-- AlgoliaSearch `latest` warning --\nWarning, you are using the `latest` version string from jsDelivr to load the AlgoliaSearch library.\nUsing `latest` is no more recommended, you should load //cdn.jsdelivr.net/algoliasearch/2/algoliasearch.min.js\n\nAlso, we updated the AlgoliaSearch JavaScript client to V3. If you want to upgrade,\nplease read our migration guide at https://github.com/algolia/algoliasearch-client-js/wiki/Migration-guide-from-2.x.x-to-3.x.x\n-- /AlgoliaSearch `latest` warning --"):
6
+ m.console.log&&m.console.log("-- AlgoliaSearch `latest` warning --\nWarning, you are using the `latest` version string from jsDelivr to load the AlgoliaSearch library.\nUsing `latest` is no more recommended, you should load //cdn.jsdelivr.net/algoliasearch/2/algoliasearch.min.js\n\nAlso, we updated the AlgoliaSearch JavaScript client to V3. If you want to upgrade,\nplease read our migration guide at https://github.com/algolia/algoliasearch-client-js/wiki/Migration-guide-from-2.x.x-to-3.x.x\n-- /AlgoliaSearch `latest` warning --"));
7
+ try{document.write("<script>window.ALGOLIA_SUPPORTS_DOCWRITE = true\x3c/script>"),!0===m.ALGOLIA_SUPPORTS_DOCWRITE?(document.write('<script src="'+l+'">\x3c/script>'),g("document.write")()):f(l,g("DOMElement"))}catch(a){f(l,g("DOMElement"))}}}).call(this,"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{1:1}],4:[function(e,h,n){(function(e){h.exports=function(){e.AlgoliaSearch=function(){throw Error("-- AlgoliaSearch V2 => V3 error --\nYou are trying to use a new version of the AlgoliaSearch JavaScript client with an old notation.\nPlease read our migration guide at https://github.com/algolia/algoliasearch-client-js/wiki/Migration-guide-from-2.x.x-to-3.x.x\n-- /AlgoliaSearch V2 => V3 error --");
8
+ };e.AlgoliaSearchHelper=function(){throw Error("-- AlgoliaSearch V2 => V3 error --\nYou are trying to use a new version of the AlgoliaSearch JavaScript client with an old notation.\nPlease read our migration guide at https://github.com/algolia/algoliasearch-client-js/wiki/Migration-guide-from-2.x.x-to-3.x.x\n-- /AlgoliaSearch V2 => V3 error --");};AlgoliaExplainResults=function(){throw Error("-- AlgoliaSearch V2 => V3 error --\nYou are trying to use a new version of the AlgoliaSearch JavaScript client with an old notation.\nPlease read our migration guide at https://github.com/algolia/algoliasearch-client-js/wiki/Migration-guide-from-2.x.x-to-3.x.x\n-- /AlgoliaSearch V2 => V3 error --");
9
+ }}}).call(this,"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{}],5:[function(e,h,n){h=e(2);n=e(3);e=e(4);h("algoliasearch")?n("algoliasearch"):e()},{2:2,3:3,4:4}]},{},[5])(5)});
10
+ (function(B){"object"===typeof exports&&"undefined"!==typeof module?module.exports=B():"function"===typeof define&&define.amd?define([],B):("undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:this).algoliasearch=B()})(function(){return function e(h,n,m){function g(a,b){if(!n[a]){if(!h[a]){var c="function"==typeof require&&require;if(!b&&c)return c(a,!0);if(l)return l(a,!0);c=Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c;}c=n[a]=
11
+ {exports:{}};h[a][0].call(c.exports,function(b){var c=h[a][1][b];return g(c?c:b)},c,c.exports,e,h,n,m)}return n[a].exports}for(var l="function"==typeof require&&require,f=0;f<m.length;f++)g(m[f]);return g}({1:[function(e,h,n){(function(m){function g(a,d){return new f(function(k,e){function f(){if(!n){b.timeout||clearTimeout(p);var a=null;try{a=JSON.parse(h.responseText)}catch(c){}k({body:a,statusCode:h.status})}}function g(a){n||(b.timeout||clearTimeout(p),e(Error("Could not connect to host, error was:"+
12
+ a)))}function l(){b.timeout||(n=!0,h.abort());k(Error("Timeout - Could not connect to endpoint "+a))}if(b.cors||b.hasXDomainRequest){var m=null,h=b.cors?new XMLHttpRequest:new XDomainRequest,p,n;void 0!==d.body&&(m=JSON.stringify(d.body));h instanceof XMLHttpRequest?h.open(d.method,a,!0):h.open(d.method,a);b.cors&&m&&"GET"!==d.method&&h.setRequestHeader("Content-type","application/x-www-form-urlencoded");h.onload=f;h.onerror=g;b.timeout?(h.timeout=d.timeout,h.ontimeout=l):p=setTimeout(l,d.timeout);
13
+ h.send(m)}else e(Error("CORS not supported"))})}var l=e(6);h.exports=l(g);var f=m.Promise||e(3).Promise,a=e(5),b={hasXMLHttpRequest:"XMLHttpRequest"in window,hasXDomainRequest:"XDomainRequest"in window,cors:"withCredentials"in new XMLHttpRequest,timeout:"timeout"in new XMLHttpRequest};g.fallback=function(b,d){return new f(function(k,e){a(b,d,function(a,b){a?e(a):k(b)})})};g.reject=function(a){return f.reject(a)};g.resolve=function(a){return f.resolve(a)};g.delay=function(a){return new f(function(b){setTimeout(b,
14
+ a)})}}).call(this,"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{3:3,5:5,6:6}],2:[function(e,h,n){function m(){if(!f){f=!0;for(var a,b=l.length;b;){a=l;l=[];for(var c=-1;++c<b;)a[c]();b=l.length}f=!1}}function g(){}e=h.exports={};var l=[],f=!1;e.nextTick=function(a){l.push(a);f||setTimeout(m,0)};e.title="browser";e.browser=!0;e.env={};e.argv=[];e.version="";e.versions={};e.on=g;e.addListener=g;e.once=g;e.off=g;e.removeListener=g;e.removeAllListeners=
15
+ g;e.emit=g;e.binding=function(a){throw Error("process.binding is not supported");};e.cwd=function(){return"/"};e.chdir=function(a){throw Error("process.chdir is not supported");};e.umask=function(){return 0}},{}],3:[function(e,h,n){(function(e,g){(function(){function l(a){return"function"===typeof a}function f(){return function(){e.nextTick(d)}}function a(){var a=0,b=new J(d),c=document.createTextNode("");b.observe(c,{characterData:!0});return function(){c.data=a=++a%2}}function b(){var a=new MessageChannel;
16
+ a.port1.onmessage=d;return function(){a.port2.postMessage(0)}}function c(){return function(){setTimeout(d,1)}}function d(){for(var a=0;a<w;a+=2)(0,A[a])(A[a+1]),A[a]=void 0,A[a+1]=void 0;w=0}function k(){}function n(a,b,c,d){try{a.call(b,c,d)}catch(k){return k}}function y(a,b,c){C(function(a){var z=!1,d=n(c,b,function(c){z||(z=!0,b!==c?q(a,c):r(a,c))},function(b){z||(z=!0,p(a,b))},"Settle: "+(a._label||" unknown promise"));!z&&d&&(z=!0,p(a,d))},a)}function E(a,b){1===b._state?r(a,b._result):2===a._state?
17
+ p(a,b._result):D(b,void 0,function(b){q(a,b)},function(b){p(a,b)})}function q(a,b){if(a===b)p(a,new TypeError("You cannot resolve a promise with itself"));else if("function"===typeof b||"object"===typeof b&&null!==b)if(b.constructor===a.constructor)E(a,b);else{var c;try{c=b.then}catch(d){F.error=d,c=F}c===F?p(a,F.error):void 0===c?r(a,b):l(c)?y(a,b,c):r(a,b)}else r(a,b)}function t(a){a._onerror&&a._onerror(a._result);G(a)}function r(a,b){void 0===a._state&&(a._result=b,a._state=1,0!==a._subscribers.length&&
18
+ C(G,a))}function p(a,b){void 0===a._state&&(a._state=2,a._result=b,C(t,a))}function D(a,b,c,d){var k=a._subscribers,e=k.length;a._onerror=null;k[e]=b;k[e+1]=c;k[e+2]=d;0===e&&a._state&&C(G,a)}function G(a){var b=a._subscribers,c=a._state;if(0!==b.length){for(var d,k,e=a._result,f=0;f<b.length;f+=3)d=b[f],k=b[f+c],d?K(c,d,k,e):k(e);a._subscribers.length=0}}function I(){this.error=null}function K(a,b,c,d){var k=l(c),e,f,g,h;if(k){try{e=c(d)}catch(m){H.error=m,e=H}e===H?(h=!0,f=e.error,e=null):g=!0;
19
+ if(b===e){p(b,new TypeError("A promises callback cannot return that same promise."));return}}else e=d,g=!0;void 0===b._state&&(k&&g?q(b,e):h?p(b,f):1===a?r(b,e):2===a&&p(b,e))}function N(a,b){try{b(function(b){q(a,b)},function(b){p(a,b)})}catch(c){p(a,c)}}function u(a,b,c,d){this._instanceConstructor=a;this.promise=new a(k,d);this._abortOnReject=c;this._validateInput(b)?(this._input=b,this._remaining=this.length=b.length,this._init(),0===this.length?r(this.promise,this._result):(this.length=this.length||
20
+ 0,this._enumerate(),0===this._remaining&&r(this.promise,this._result))):p(this.promise,this._validationError())}function v(a){this._id=O++;this._result=this._state=void 0;this._subscribers=[];if(k!==a){if(!l(a))throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");if(!(this instanceof v))throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");N(this,a)}}var L=Array.isArray?
21
+ Array.isArray:function(a){return"[object Array]"===Object.prototype.toString.call(a)},w=0,C=function(a,b){A[w]=a;A[w+1]=b;w+=2;2===w&&M()},x="undefined"!==typeof window?window:{},J=x.MutationObserver||x.WebKitMutationObserver,x="undefined"!==typeof Uint8ClampedArray&&"undefined"!==typeof importScripts&&"undefined"!==typeof MessageChannel,A=Array(1E3),M;M="undefined"!==typeof e&&"[object process]"==={}.toString.call(e)?f():J?a():x?b():c();var F=new I,H=new I;u.prototype._validateInput=function(a){return L(a)};
22
+ u.prototype._validationError=function(){return Error("Array Methods must be provided an Array")};u.prototype._init=function(){this._result=Array(this.length)};u.prototype._enumerate=function(){for(var a=this.length,b=this.promise,c=this._input,d=0;void 0===b._state&&d<a;d++)this._eachEntry(c[d],d)};u.prototype._eachEntry=function(a,b){var c=this._instanceConstructor;"object"===typeof a&&null!==a?a.constructor===c&&void 0!==a._state?(a._onerror=null,this._settledAt(a._state,b,a._result)):this._willSettleAt(c.resolve(a),
23
+ b):(this._remaining--,this._result[b]=this._makeResult(1,b,a))};u.prototype._settledAt=function(a,b,c){var d=this.promise;void 0===d._state&&(this._remaining--,this._abortOnReject&&2===a?p(d,c):this._result[b]=this._makeResult(a,b,c));0===this._remaining&&r(d,this._result)};u.prototype._makeResult=function(a,b,c){return c};u.prototype._willSettleAt=function(a,b){var c=this;D(a,void 0,function(a){c._settledAt(1,b,a)},function(a){c._settledAt(2,b,a)})};var O=0;v.all=function(a,b){return(new u(this,
24
+ a,!0,b)).promise};v.race=function(a,b){function c(a){q(e,a)}function d(a){p(e,a)}var e=new this(k,b);if(!L(a))return p(e,new TypeError("You must pass an array to race.")),e;for(var f=a.length,g=0;void 0===e._state&&g<f;g++)D(this.resolve(a[g]),void 0,c,d);return e};v.resolve=function(a,b){if(a&&"object"===typeof a&&a.constructor===this)return a;var c=new this(k,b);q(c,a);return c};v.reject=function(a,b){var c=new this(k,b);p(c,a);return c};v.prototype={constructor:v,then:function(a,b){var c=this._state;
25
+ if(1===c&&!a||2===c&&!b)return this;var d=new this.constructor(k),e=this._result;if(c){var f=arguments[c-1];C(function(){K(c,d,f,e)})}else D(this,d,a,b);return d},"catch":function(a){return this.then(null,a)}};x={Promise:v,polyfill:function(){var a;a="undefined"!==typeof g?g:"undefined"!==typeof window&&window.document?window:self;"Promise"in a&&"resolve"in a.Promise&&"reject"in a.Promise&&"all"in a.Promise&&"race"in a.Promise&&function(){var b;new a.Promise(function(a){b=a});return l(b)}()||(a.Promise=
26
+ v)}};"undefined"!==typeof h&&h.exports?h.exports=x:"undefined"!==typeof this&&(this.ES6Promise=x)}).call(this)}).call(this,e(2),"undefined"!==typeof global?global:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{2:2}],4:[function(e,h,n){(function(e){function g(a,b,c,d){if(!a)throw Error("Please provide an application ID. Usage: algoliasearch(applicationID, apiKey, opts)");if(!b)throw Error("Please provide an API key. Usage: algoliasearch(applicationID, apiKey, opts)");c=c||
27
+ {};void 0===c.timeout&&(c.timeout=2E3);void 0===c.protocol&&(c.protocol=document&&document.location.protocol||"http:");void 0===c.hosts&&(c.hosts=[]);void 0===c.tld&&(c.tld="net");/:$/.test(c.protocol)||(c.protocol+=":");0===c.hosts.length&&(c.hosts=f([a+"-1.algolia."+c.tld,a+"-2.algolia."+c.tld,a+"-3.algolia."+c.tld]),c.hosts.unshift(a+"-dsn.algolia."+c.tld));c.hosts=l(c.hosts,function(a){return c.protocol+"//"+a});this.applicationID=a;this.apiKey=b;this.hosts=c.hosts;this.currentHostIndex=0;this.requestTimeout=
28
+ c.timeout;this.extraHeaders=[];this.cache={};this._request=d}function l(a,b){for(var c=[],d=0;d<a.length;++d)c.push(b(a[d],d));return c}function f(a){for(var b=a.length,c,d;0!==b;)d=Math.floor(Math.random()*b),--b,c=a[b],a[b]=a[d],a[d]=c;return a}h.exports=g;g.prototype={deleteIndex:function(a,b){return this._jsonRequest({method:"DELETE",url:"/1/indexes/"+encodeURIComponent(a),callback:b})},moveIndex:function(a,b,c){b={operation:"move",destination:b};return this._jsonRequest({method:"POST",url:"/1/indexes/"+
29
+ encodeURIComponent(a)+"/operation",body:b,callback:c})},copyIndex:function(a,b,c){b={operation:"copy",destination:b};return this._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(a)+"/operation",body:b,callback:c})},getLogs:function(a,b,c){if(0===arguments.length||"function"===typeof a)c=a,a=0,b=10;else if(1===arguments.length||"function"===typeof b)c=b,b=10;return this._jsonRequest({method:"GET",url:"/1/logs?offset="+a+"&length="+b,callback:c})},listIndexes:function(a,b){var c="";
30
+ void 0===a||"function"===typeof a?b=a:c="?page="+a;return this._jsonRequest({method:"GET",url:"/1/indexes"+c,callback:b})},initIndex:function(a){return new this.Index(this,a)},listUserKeys:function(a){return this._jsonRequest({method:"GET",url:"/1/keys",callback:a})},getUserKeyACL:function(a,b){return this._jsonRequest({method:"GET",url:"/1/keys/"+a,callback:b})},deleteUserKey:function(a,b){return this._jsonRequest({method:"DELETE",url:"/1/keys/"+a,callback:b})},addUserKey:function(a,b){return this.addUserKeyWithValidity(a,
31
+ {validity:0,maxQueriesPerIPPerHour:0,maxHitsPerQuery:0},b)},addUserKeyWithValidity:function(a,b,c){var d={};d.acl=a;d.validity=b.validity;d.maxQueriesPerIPPerHour=b.maxQueriesPerIPPerHour;d.maxHitsPerQuery=b.maxHitsPerQuery;return this._jsonRequest({method:"POST",url:"/1/keys",body:d,callback:c})},setSecurityTags:function(a){if("[object Array]"===Object.prototype.toString.call(a)){for(var b=[],c=0;c<a.length;++c)if("[object Array]"===Object.prototype.toString.call(a[c])){for(var d=[],e=0;e<a[c].length;++e)d.push(a[c][e]);
32
+ b.push("("+d.join(",")+")")}else b.push(a[c]);a=b.join(",")}this.tagFilters=a},setUserToken:function(a){this.userToken=a},startQueriesBatch:function(){this.batch=[]},addQueryInBatch:function(a,b,c){b="query="+encodeURIComponent(b);this._isUndefined(c)||null===c||(b=this._getSearchParams(c,b));this.batch.push({indexName:a,params:b})},clearCache:function(){this.cache={}},sendQueriesBatch:function(a){for(var b={requests:[]},c=0;c<this.batch.length;++c)b.requests.push(this.batch[c]);return this._sendQueriesBatch(b,
33
+ a)},setRequestTimeout:function(a){a&&(this.requestTimeout=parseInt(a,10))},Index:function(a,b){this.indexName=b;this.as=a;this.typeAheadValueOption=this.typeAheadArgs=null;this.cache={}},setExtraHeader:function(a,b){this.extraHeaders.push({key:a,value:b})},_sendQueriesBatch:function(a,b){return this._jsonRequest({cache:this.cache,method:"POST",url:"/1/indexes/*/queries",body:a,fallback:{method:"GET",url:"/1/indexes/*",body:{params:function(){for(var b="",d=0;d<a.requests.length;++d)var e="/1/indexes/"+
34
+ encodeURIComponent(a.requests[d].indexName)+"?"+a.requests[d].params,b=b+(d+"="+encodeURIComponent(e)+"&");return b}()}},callback:b})},_jsonRequest:function(a){function b(e,g){function h(){k.currentHostIndex=++k.currentHostIndex%k.hosts.length;f+=1;g.timeout=k.requestTimeout*(f+1);return b(e,g)}if(c&&void 0!==c[d])return k._request.resolve(c[d]);if(f>=k.hosts.length){if(!a.fallback||e===k._request.fallback)return k._request.reject(Error("Cannot connect to the AlgoliaSearch API. Send an email to support@algolia.com to report and resolve the issue."));
35
+ f=0;g.method=a.fallback.method;g.url=a.fallback.url;g.body=a.fallback.body;g.timeout=k.requestTimeout*(f+1);k.currentHostIndex=0;k.forceFallback=!0;return b(k._request.fallback,g)}var l=g.url,l=l+((-1===l.indexOf("?")?"?":"&")+"X-Algolia-API-Key="+k.apiKey),l=l+("&X-Algolia-Application-Id="+k.applicationID);k.userToken&&(l+="&X-Algolia-UserToken="+encodeURIComponent(k.userToken));k.tagFilters&&(l+="&X-Algolia-TagFilters="+encodeURIComponent(k.tagFilters));for(var m=0;m<k.extraHeaders.length;++m)l+=
36
+ "&"+k.extraHeaders[m].key+"="+k.extraHeaders[m].value;return e(k.hosts[k.currentHostIndex]+l,{body:g.body,method:g.method,timeout:g.timeout}).then(function(a){if(a instanceof Error)return h();var b=a&&a.body&&a.body.message&&a.body.status||a.statusCode||a&&a.body&&200,e=200===b||201===b,b=!e&&4!==Math.floor(b/100)&&1!==Math.floor(b/100);e&&c&&(c[d]=a.body);return e?a.body:b?h():k._request.reject(Error(a.body&&a.body.message||"Unknown error"))},function(){k.forceFallback?(k.currentHostIndex=++k.currentHostIndex%
37
+ k.hosts.length,f+=1):f=k.hosts.length;return b(e,g)})}var c=a.cache,d=a.url,k=this,f=0;void 0!==a.body&&(d+="_body_"+JSON.stringify(a.body));var g=k.forceFallback&&a.fallback,h=g?a.fallback:a,g=b(g?k._request.fallback:k._request,{url:h.url,method:h.method,body:h.body,timeout:k.requestTimeout*(f+1)});if(a.callback)g.then(function(b){e.nextTick(function(){a.callback(null,b)})},function(b){e.nextTick(function(){a.callback(b)})});else return g},_getSearchParams:function(a,b){if(this._isUndefined(a)||
38
+ null===a)return b;for(var c in a)null!==c&&a.hasOwnProperty(c)&&(b+=""===b?"":"&",b+=c+"="+encodeURIComponent("[object Array]"===Object.prototype.toString.call(a[c])?JSON.stringify(a[c]):a[c]));return b},_isUndefined:function(a){return void 0===a}};g.prototype.Index.prototype={clearCache:function(){this.cache={}},addObject:function(a,b,c){if(1===arguments.length||"function"===typeof b)c=b,b=void 0;return this.as._jsonRequest({method:void 0!==b?"PUT":"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+
39
+ (void 0!==b?"/"+encodeURIComponent(b):""),body:a,callback:c})},addObjects:function(a,b){for(var c={requests:[]},d=0;d<a.length;++d)c.requests.push({action:"addObject",body:a[d]});return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/batch",body:c,callback:b})},getObject:function(a,b,c){if(1===arguments.length||"function"===typeof b)c=b,b=void 0;var d="";if(void 0!==b)for(var d="?attributes=",e=0;e<b.length;++e)0!==e&&(d+=","),d+=b[e];return this.as._jsonRequest({method:"GET",
40
+ url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/"+encodeURIComponent(a)+d,callback:c})},partialUpdateObject:function(a,b){return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/"+encodeURIComponent(a.objectID)+"/partial",body:a,callback:b})},partialUpdateObjects:function(a,b){for(var c={requests:[]},d=0;d<a.length;++d)c.requests.push({action:"partialUpdateObject",objectID:a[d].objectID,body:a[d]});return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+
41
+ encodeURIComponent(this.indexName)+"/batch",body:c,callback:b})},saveObject:function(a,b){return this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/"+encodeURIComponent(a.objectID),body:a,callback:b})},saveObjects:function(a,b){for(var c={requests:[]},d=0;d<a.length;++d)c.requests.push({action:"updateObject",objectID:a[d].objectID,body:a[d]});return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/batch",body:c,callback:b})},
42
+ deleteObject:function(a,b){if("function"===typeof a||"string"!==typeof a&&"number"!==typeof a){var c=Error("Cannot delete an object without an objectID");b=a;return"function"===typeof b?b(c):this.as._request.reject(c)}return this.as._jsonRequest({method:"DELETE",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/"+encodeURIComponent(a),callback:b})},search:function(a,b,c){if(0===arguments.length||"function"===typeof a)c=a,a="";else if(1===arguments.length||"function"===typeof b)c=b,b=void 0;if("object"===
43
+ typeof a&&null!==a)b=a,a=void 0;else if(void 0===a||null===a)a="";var d="";void 0!==a&&(d+="query="+encodeURIComponent(a));void 0!==b&&(d=this.as._getSearchParams(b,d));return this._search(d,c)},browse:function(a,b,c){if(1===arguments.length||"function"===typeof b)c=b,b=void 0;var d="?page="+a;this.as._isUndefined(b)||(d+="&hitsPerPage="+b);return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/browse"+d,callback:c})},ttAdapter:function(a){var b=this;return function(c,
44
+ d){b.search(c,a,function(a,b){a?d(a):d(b.hits)})}},waitTask:function(a,b){var c=this,d=this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(c.indexName)+"/task/"+a}).then(function(d){if("published"!==d.status)return(new c.as._request.delay(100)).then(function(){return c.waitTask(a,b)});if(b)e.nextTick(function(){b(null,d)});else return d},function(a){if(b)e.nextTick(function(){b(a)});else return a});if(!b)return d},clearIndex:function(a){return this.as._jsonRequest({method:"POST",
45
+ url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/clear",callback:a})},getSettings:function(a){return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/settings",callback:a})},setSettings:function(a,b){return this.as._jsonRequest({method:"PUT",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/settings",body:a,callback:b})},listUserKeys:function(a){return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys",
46
+ callback:a})},getUserKeyACL:function(a,b){return this.as._jsonRequest({method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys/"+a,callback:b})},deleteUserKey:function(a,b){return this.as._jsonRequest({method:"DELETE",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys/"+a,callback:b})},addUserKey:function(a,b){var c={};c.acl=a;return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys",body:c,callback:b})},addUserKeyWithValidity:function(a,
47
+ b,c){var d={};d.acl=a;d.validity=b.validity;d.maxQueriesPerIPPerHour=b.maxQueriesPerIPPerHour;d.maxHitsPerQuery=b.maxHitsPerQuery;return this.as._jsonRequest({method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/keys",body:d,callback:c})},_search:function(a,b){return this.as._jsonRequest({cache:this.cache,method:"POST",url:"/1/indexes/"+encodeURIComponent(this.indexName)+"/query",body:{params:a},fallback:{method:"GET",url:"/1/indexes/"+encodeURIComponent(this.indexName),body:{params:a}},
48
+ callback:b})},as:null,indexName:null,typeAheadArgs:null,typeAheadValueOption:null}}).call(this,e(2))},{2:2}],5:[function(e,h,n){h.exports=function(e,h,f){function a(){r||y||(r=!0,n||(c(),f(Error("Failed to load JSONP script"))))}function b(){"loaded"!==this.readyState&&"complete"!==this.readyState||a()}function c(){clearTimeout(p);q.onload=null;q.onreadystatechange=null;q.onerror=null;E.removeChild(q);try{delete window[t],delete window[t+"_loaded"]}catch(a){window[t]=null,window[t+"_loaded"]=null}}
49
+ function d(){y=!0;c();f(Error("Timeout - Could not connect to endpoint "+e))}function k(){r||y||(c(),f(Error("Failed to load JSONP script")))}if("GET"!==h.method)f(Error("Method "+h.method+" "+e+" is not supported by JSONP."));else{var n=!1,y=!1;m+=1;var E=document.getElementsByTagName("head")[0],q=document.createElement("script"),t="algoliaJSONP_"+m,r=!1;window[t]=function(a){try{delete window[t]}catch(b){window[t]=void 0}y||(n=!0,c(),f(null,{body:a}))};e+="&callback="+t;h.body&&h.body.params&&(e+=
50
+ "&"+h.body.params);var p=setTimeout(d,h.timeout);q.onreadystatechange=b;q.onload=a;q.onerror=k;q.async=!0;q.defer=!0;q.src=e;E.appendChild(q)}};var m=0},{}],6:[function(e,h,n){h.exports=function(h){function g(g,f,a){return new (e(4))(g,f,a,h)}g.version="3.0.3";return g}},{4:4}]},{},[1])(1)});
metadata CHANGED
@@ -1,111 +1,111 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: algoliasearch-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.17
4
+ version: 1.11.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Algolia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-08 00:00:00.000000000 Z
11
+ date: 2015-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: 1.5.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: 1.5.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: algoliasearch
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: 1.2.14
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.2.14
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: will_paginate
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: 2.3.15
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: 2.3.15
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: kaminari
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - '>='
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ">="
66
+ - - '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: travis
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - '>='
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - '>='
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - '>='
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - '>='
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rdoc
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - '>='
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">="
108
+ - - '>='
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  description: AlgoliaSearch integration to your favorite ORM
@@ -117,9 +117,9 @@ extra_rdoc_files:
117
117
  - LICENSE
118
118
  - README.md
119
119
  files:
120
- - ".document"
121
- - ".rspec"
122
- - ".travis.yml"
120
+ - .document
121
+ - .rspec
122
+ - .travis.yml
123
123
  - ChangeLog
124
124
  - Gemfile
125
125
  - Gemfile.lock
@@ -145,9 +145,23 @@ files:
145
145
  - vendor/assets/javascripts/algolia/algoliasearch.js
146
146
  - vendor/assets/javascripts/algolia/algoliasearch.min.js
147
147
  - vendor/assets/javascripts/algolia/bloodhound.js
148
+ - vendor/assets/javascripts/algolia/bloodhound.min.js
148
149
  - vendor/assets/javascripts/algolia/typeahead.bundle.js
149
150
  - vendor/assets/javascripts/algolia/typeahead.bundle.min.js
150
151
  - vendor/assets/javascripts/algolia/typeahead.jquery.js
152
+ - vendor/assets/javascripts/algolia/typeahead.jquery.min.js
153
+ - vendor/assets/javascripts/algolia/v2/algoliasearch.angular.js
154
+ - vendor/assets/javascripts/algolia/v2/algoliasearch.angular.min.js
155
+ - vendor/assets/javascripts/algolia/v2/algoliasearch.jquery.js
156
+ - vendor/assets/javascripts/algolia/v2/algoliasearch.jquery.min.js
157
+ - vendor/assets/javascripts/algolia/v2/algoliasearch.js
158
+ - vendor/assets/javascripts/algolia/v2/algoliasearch.min.js
159
+ - vendor/assets/javascripts/algolia/v3/algoliasearch.angular.js
160
+ - vendor/assets/javascripts/algolia/v3/algoliasearch.angular.min.js
161
+ - vendor/assets/javascripts/algolia/v3/algoliasearch.jquery.js
162
+ - vendor/assets/javascripts/algolia/v3/algoliasearch.jquery.min.js
163
+ - vendor/assets/javascripts/algolia/v3/algoliasearch.js
164
+ - vendor/assets/javascripts/algolia/v3/algoliasearch.min.js
151
165
  homepage: http://github.com/algolia/algoliasearch-rails
152
166
  licenses:
153
167
  - MIT
@@ -158,17 +172,17 @@ require_paths:
158
172
  - lib
159
173
  required_ruby_version: !ruby/object:Gem::Requirement
160
174
  requirements:
161
- - - ">="
175
+ - - '>='
162
176
  - !ruby/object:Gem::Version
163
177
  version: '0'
164
178
  required_rubygems_version: !ruby/object:Gem::Requirement
165
179
  requirements:
166
- - - ">="
180
+ - - '>='
167
181
  - !ruby/object:Gem::Version
168
182
  version: '0'
169
183
  requirements: []
170
184
  rubyforge_project:
171
- rubygems_version: 2.2.2
185
+ rubygems_version: 2.0.14
172
186
  signing_key:
173
187
  specification_version: 4
174
188
  summary: AlgoliaSearch integration to your favorite ORM