Skip to content

Commit

Permalink
Merge pull request thybag#16 from thybag/develop
Browse files Browse the repository at this point in the history
Make v0.9.1 stable branch
  • Loading branch information
thybag authored Oct 6, 2016
2 parents 3714306 + ef2db70 commit 03a2d88
Show file tree
Hide file tree
Showing 9 changed files with 509 additions and 138 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/orig.js
/node_modules
55 changes: 55 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -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']);
};
8 changes: 5 additions & 3 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
{
"name": "thybag/quick-spot",
"version": "0.8.2",
"version": "0.9.1",
"main": "quickspot.js",
"description": "Quickspot is a fast, flexible JSON powered in-memory search. ",
"license": "MIT",
"keywords": ["search","quicksearch"],
"ignore": [
"demo/",
"readme.md"
"readme.md",
"test/",
".gitignore"
]
}
}
82 changes: 39 additions & 43 deletions demo/index.html
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Quick-Spot - A simple high speed JSON search</title>
<title>Quick-Spot - A simple, high speed, high flexibility JSON powered search</title>

<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap.min.css" rel="stylesheet" />
<link href="//maxcdn.bootstrapcdn.com/bootswatch/3.3.6/flatly/bootstrap.min.css" rel="stylesheet">
<link href="../quickspot.css" rel="stylesheet" />
<style type='text/css'>
.container-medium {
margin: 0 auto;
max-width: 820px;
.quickspot-container {
width:100%;
}
.container-medium > hr {
margin: 20px 0;
.quickspot-container input {
border-radius: 0px;
}
.quickspot-container input:focus, .quickspot-results-container {
border-color: #15a589;
}
.quickspot-results-container .quickspot-results .quickspot-result {
color: #000;
padding:8px 10px;
}
.quickspot-results-container .quickspot-results .quickspot-result.selected{
background:#15a589;
color:#fff;
}
.navbar {
/* margin: 20px 0;*/
}
</style>

<script type='text/javascript' src='../quickspot.js'></script>
<script type='text/javascript'>
//Note: this is sample data, ucas codes & other attributes just randomly made up
// Note: this is sample data, ucas codes & other attributes just randomly made up
var test_data = [
{
"ucas": "UK89801",
Expand Down Expand Up @@ -117,7 +124,7 @@
"data":test_data,
"target":"searchbox2",
"display_handler": function(co){
return '<strong>'+co.name+'</strong> - '+co.award+'<br><small>'+co.ucas+' / '+co.subject+'</small>';
return co.name+' - '+co.award+'<br><small>'+co.ucas+' / '+co.subject+'</small>';
},
"click_handler": function(co){
// You would probably want to do something more useful here
Expand All @@ -130,41 +137,30 @@
</script>
</head>
<body>
<div class="container-medium">
<div class="container">
<div class="masthead">
<ul class="nav nav-pills pull-right">
<li class="active"><a href="#">Home</a></li>
<li><a href="http://github.com/thybag/quick-spot">Github</a></li>
</ul>
<h3 class="muted" >Quick Spot Demo</h3>
</div>
<hr>
<div class='row'>
<div class='span5'>

<h4 style='height:50px;'>Normal usage</h4>
<ul class="nav nav-pills pull-right">
<li class="active"><a href="#">Home</a></li>
<li><a href="http://github.com/thybag/quick-spot">Github</a></li>
</ul>
<h3 class="muted" >Quick Spot Demo</h3>
</div>
<hr>
<div class='row'>
<div class='col-sm-6'>

<div class=" navbar navbar-inverse">
<div class="navbar-inner">
<div class='search_bar'>
<div class="navbar-form pull-left">
<div class='quickspot-container'><input type='text' id='searchbox' placeholder='Try me...' /></div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">Normal usage</div>
<div class="panel-body">
<div class='quickspot-container'><input type='text' id='searchbox' placeholder='Try me...' class="form-control"/></div>
</div>
</div>
</div>
<div class='span5' style='margin-left:58px;'>

<h4 style='height:50px;'>With custom display (alerts when clicked)</h4>

<div class=" navbar navbar-inverse">
<div class="navbar-inner">
<div class='search_bar'>
<div class="navbar-form pull-left">
<div class='quickspot-container'><input type='text' id='searchbox2' placeholder='Try me also' /></div>
</div>
</div>
</div>
<div class='col-sm-6'>
<div class="panel panel-default">
<div class="panel-heading">With custom display </div>
<div class="panel-body">
<div class='quickspot-container'><input type='text' id='searchbox2' placeholder='Try me also' class="form-control"/></div>
</div>
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "quick-spot",
"version": "0.8.2",
"version": "0.9.1",
"description": "Quickspot is a fast, flexible JSON powered in-memory search.",
"main": "quickspot.js",
"files": [
Expand All @@ -27,6 +27,7 @@
"devDependencies": {
"grunt": "^0.4.5",
"grunt-contrib-connect": "^1.0.0",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-uglify": "^1.0.1",
"grunt-contrib-watch": "^1.0.0",
"grunt-eslint": "^18.0.0"
Expand Down
16 changes: 5 additions & 11 deletions quickspot.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,18 @@
position:relative;
/*Oddly IE7 is fine without this, IE8 on the other hand gets a bit confused*/
position:absolute\9;
display:inline-block;
}
.quickspot-container input {
height: 20px;
margin-top:5px;
padding:4px 6px;
}
.quickspot-container input {}
.quickspot-results-container {
width:340px;
width:100%;
position:absolute;
top:35px;
left:0;
z-index:9999;
border-radius: 0px;
border:solid 1px #08c;
border:solid 1px #777;
background:#fff;
}
.quickspot-results-container .quickspot-results {

max-height:380px;
overflow:auto;
}
Expand All @@ -30,6 +24,6 @@
cursor:pointer;
}
.quickspot-results-container .quickspot-results .quickspot-result.selected{
background:#08c;
background:#777;
color:#fff;
}
Loading

0 comments on commit 03a2d88

Please sign in to comment.