Comparing version 0.9.0 to 0.9.1
{ | ||
"name": "sajari", | ||
"version": "0.9.0", | ||
"version": "0.9.1", | ||
"description": "JavaScript SDK for access to the Sajari search API", | ||
@@ -5,0 +5,0 @@ "author": { |
@@ -437,28 +437,30 @@ /* | ||
*/ | ||
jsonpSend : function(path, args, success, failure) { | ||
jsonpSend: function(path, args, success, failure) { | ||
var uri = url.augmentUri(path, args); | ||
var seq = '_jsonp_' + (searchSeq++); | ||
var script = document.createElement('script'); | ||
var seq = '_jsonp_' + (searchSeq++); | ||
var script = document.createElement('script'); | ||
window['__SJ'+seq] = function(response) { | ||
success(response); | ||
try { | ||
delete window['__SJ'+seq]; | ||
} catch (e) { | ||
window['__SJ'+seq] = undefined; | ||
} | ||
script.parentNode.removeChild(script); | ||
}; | ||
script.onerror = function() { | ||
failure(); | ||
try { | ||
delete window['__SJ'+seq]; | ||
} catch (e) { | ||
window['__SJ'+seq] = undefined; | ||
} | ||
script.parentNode.removeChild(script); | ||
}; | ||
window['__SJ' + seq] = function(response) { | ||
success(response); | ||
try { | ||
delete window['__SJ' + seq]; | ||
} catch (e) { | ||
window['__SJ' + seq] = undefined; | ||
} | ||
script.parentNode.removeChild(script); | ||
}; | ||
script.onerror = function() { | ||
failure(); | ||
try { | ||
delete window['__SJ' + seq]; | ||
} catch (e) { | ||
window['__SJ' + seq] = undefined; | ||
} | ||
script.parentNode.removeChild(script); | ||
}; | ||
script.src = url.augmentUri(uri, { jsoncallback: '__SJ'+seq }); | ||
document.getElementsByTagName('head')[0].appendChild(script); | ||
script.src = url.augmentUri(uri, { | ||
jsoncallback: '__SJ' + seq | ||
}); | ||
document.getElementsByTagName('head')[0].appendChild(script); | ||
} | ||
@@ -465,0 +467,0 @@ }; |
@@ -100,4 +100,9 @@ var isArray = require('./utils/isArray'); | ||
// Join the facet.fields array | ||
if (this.options['facet.fields'] !== undefined) { | ||
args['facet.fields'] = this.options['facet.fields'].join(','); | ||
var ffs = this.options['facet.fields']; | ||
if (ffs !== undefined) { | ||
if (isArray(ffs)) { | ||
args['facet.fields'] = ffs.join(','); | ||
} else { | ||
args['facet.fields'] = ffs; | ||
} | ||
} | ||
@@ -104,0 +109,0 @@ |
@@ -99,1 +99,11 @@ | ||
}); | ||
var query5 = api.query(); | ||
query5.facetfields("disco", 5); | ||
test('Query encoding 5', function (t) { | ||
var enc = query5.encode(); | ||
t.equal(enc["facet.fields"], "disco"); | ||
t.end(); | ||
}); | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38435
1097