sajari-website
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -5,7 +5,9 @@ var gulp = require('gulp'); | ||
var jshint = require('gulp-jshint'); | ||
var jslint = require('gulp-jslint'); | ||
var watch = require('gulp-watch'); | ||
var tape = require('gulp-tape'); | ||
var tapColorize = require('tap-colorize'); | ||
var exec = require('child_process').exec; | ||
var map = require('map-stream'); | ||
var browserify = require('browserify'); | ||
@@ -15,2 +17,9 @@ var source = require('vinyl-source-stream'); | ||
gulp.task('lint', function() { | ||
gulp.src('./src/js/*.js') | ||
.pipe(jshint()) | ||
.pipe(jshint.reporter('jshint-stylish')) | ||
}); | ||
gulp.task('test', function() { | ||
@@ -31,3 +40,4 @@ return gulp.src('tests/*.js') | ||
gulp.task('widgets', ['compile-templates', 'test'], function() { | ||
gulp.task('widgets', ['compile-templates', 'test', 'lint'], function() { | ||
return browserify('./src/js/widgets.js') | ||
@@ -59,3 +69,3 @@ .bundle().on('error', function(e){ | ||
gulp.task('default', ['compile-templates', 'widgets', 'compress-widgets']); | ||
gulp.task('default', ['compile-templates', 'widgets']); | ||
@@ -62,0 +72,0 @@ gulp.task("watch", function() { |
{ | ||
"name": "sajari-website", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Website extensions for the Sajari API. Automatically index site content, add user profiles, render search and recommendations, etc.", | ||
@@ -39,2 +39,3 @@ "author": { | ||
"gulp-jshint": "^2.0.0", | ||
"gulp-jslint": "^0.2.2", | ||
"gulp-shell": "^0.5.1", | ||
@@ -46,2 +47,3 @@ "gulp-tape": "0.0.7", | ||
"jshint": "^2.8.0", | ||
"jshint-stylish": "^2.1.0", | ||
"tap-colorize": "^1.2.0", | ||
@@ -48,0 +50,0 @@ "tape": "^4.4.0", |
@@ -39,3 +39,3 @@ /* | ||
if (id !== undefined) { | ||
this.visitorId = id + '' | ||
this.visitorId = id + ''; | ||
cookie.set('sjID', this.visitorId, 365); | ||
@@ -45,3 +45,3 @@ } | ||
} | ||
} | ||
}; | ||
@@ -48,0 +48,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
require("./utils/polyfills") | ||
require("./utils/polyfills"); | ||
@@ -33,3 +33,3 @@ var loaded = require("./utils/loaded"); | ||
] | ||
} | ||
}; | ||
// Initialize DOM functionality | ||
@@ -48,3 +48,3 @@ var dom = new (require("./utils/dom"))(opts); | ||
Id : undefined | ||
} | ||
}; | ||
@@ -54,6 +54,2 @@ // function stack queue | ||
// We define this to make it global to this module, it will be initialized later on install. | ||
var api = undefined; | ||
/** | ||
@@ -68,5 +64,5 @@ * Process an array or object of options | ||
} else if (typeof options === 'object') { | ||
for (var i in options) { | ||
var opt = (isArray(options[i]) ? options[i].slice() : [options[i]]); | ||
opt.unshift(i); | ||
for (var j in options) { | ||
var opt = (isArray(options[j]) ? options[j].slice() : [options[j]]); | ||
opt.unshift(j); | ||
stack.push(opt); | ||
@@ -148,3 +144,3 @@ } | ||
res.fuzzyStr = res.fuzzy[i]; | ||
break | ||
break; | ||
} | ||
@@ -220,3 +216,3 @@ } | ||
return div | ||
return div; | ||
} | ||
@@ -244,3 +240,3 @@ | ||
if (dom.hasNode('overlay')) { | ||
log("Launching overlay...") | ||
log("Launching overlay..."); | ||
dom.firstNode('overlay').style.display = 'block'; | ||
@@ -306,3 +302,3 @@ } | ||
if (auto) { | ||
node.value = auto | ||
node.value = auto; | ||
builtInSearch.apply(node); | ||
@@ -378,3 +374,3 @@ } | ||
} | ||
} | ||
}; | ||
@@ -398,3 +394,3 @@ /** | ||
// Merge in profile meta | ||
for (var key in profile.meta) { | ||
for (key in profile.meta) { | ||
metaToSend["meta["+key+"]"] = profile.meta[key]; | ||
@@ -534,9 +530,9 @@ } | ||
data['profile.query'] = 'true'; | ||
data['personalization'] = 'true'; | ||
data.personalization = 'true'; | ||
} | ||
if (dom.hasNode('search-recent')) { | ||
data['recent'] = 'true'; | ||
data.recent = 'true'; | ||
} | ||
if (dom.hasNode('local')) { | ||
data['local'] = 'true'; | ||
data.local = 'true'; | ||
} | ||
@@ -750,3 +746,3 @@ | ||
if (!dom.hasNode('search-query')) { | ||
return | ||
return; | ||
} | ||
@@ -798,5 +794,5 @@ | ||
if (node !== undefined) { | ||
u = node.getAttribute('href') // This is a mousedown event | ||
u = node.getAttribute('href'); // This is a mousedown event | ||
} else { | ||
u = window.location.href // No node, this must be the destination page | ||
u = window.location.href; // No node, this must be the destination page | ||
} | ||
@@ -858,3 +854,3 @@ api.pixel({ | ||
module.exports = SJ | ||
module.exports = SJ; | ||
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
48672
1234
1
16