From ac3e45541bc09edd73c1c771340b499498366636 Mon Sep 17 00:00:00 2001 From: thybag Date: Sun, 20 Mar 2016 19:56:57 +0000 Subject: [PATCH 01/14] start updating demo to newer design. Auto highlight on by default. Start putting in infrastructure for tests. --- Gruntfile.js | 55 ++++++++++++++++++++++++ demo/index.html | 111 +++++++++++++++++++++++++++++------------------- package.json | 1 + quickspot.css | 16 +++---- quickspot.js | 35 +++++++-------- 5 files changed, 147 insertions(+), 71 deletions(-) create mode 100644 Gruntfile.js diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..501f89d --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,55 @@ +module.exports = function (grunt) { + "use strict"; + + grunt.loadNpmTasks("grunt-contrib-connect"); + grunt.loadNpmTasks("grunt-contrib-watch"); + grunt.loadNpmTasks("grunt-contrib-uglify"); + grunt.loadNpmTasks("grunt-contrib-copy"); + grunt.loadNpmTasks("grunt-eslint"); + + grunt.initConfig({ + eslint: { + all: { + options: { + configFile: "test/_eslint.json" + }, + src: ["quickspot.js"] + } + }, + uglify: { + all: { + files: { + "quickspot.min.js": ["quickspot.js"] + } + } + }, + copy: { + main: { + src: 'quickspot.*', + dest: 'demo/', + }, + }, + connect: { + all: { + options: { + port: 7070, + hostname: "localhost", + base: ["demo/"], + livereload: 7071 + } + } + }, + watch: { + all: { + files: ["quickspot.js", "quickspot.css"], + tasks: ["default"], + options: { + livereload: true + } + } + } + }); + + grunt.registerTask('default', ['eslint', 'copy', 'uglify']); + grunt.registerTask('server', ['eslint','copy', 'uglify', 'connect', 'watch']); +}; diff --git a/demo/index.html b/demo/index.html index bd0bbdf..552aa5f 100644 --- a/demo/index.html +++ b/demo/index.html @@ -3,19 +3,55 @@ Quick-Spot - A simple high speed JSON search - + @@ -117,7 +153,7 @@ "data":test_data, "target":"searchbox2", "display_handler": function(co){ - return ''+co.name+' - '+co.award+'
'+co.ucas+' / '+co.subject+''; + return co.name+' - '+co.award+'
'+co.ucas+' / '+co.subject+''; }, "click_handler": function(co){ // You would probably want to do something more useful here @@ -130,41 +166,30 @@ -
+
- -

Quick Spot Demo

-
-
-
-
- -

Normal usage

+ +

Quick Spot Demo

+
+
+
+
-