jekyll-github-pages-search 0.0.2 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/gh_api_search.js +3 -0
- data/lib/jekyll-github-pages-search.rb +4 -3
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 64a91ef9d52b39071781e5003e988feac840f542
|
|
4
|
+
data.tar.gz: 2b6643674cf32bcc64c4b142d0ddfe6892c11f6d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 869d191980e4c2af47deec41efcc97e7fbf3b98b9580715665c009905a902f3ede38da89de60ca2db22a892642c32075e65ef26e8bd58ec1188c12289f2ab475
|
|
7
|
+
data.tar.gz: 4411a30f0a9153e6bdea081e9414d4ad938a79239aded0a33578ad64a02efcda16be9ef0bba4af565825d9d779440298b4d151917dd22103aaaad353a1800a6b
|
data/lib/gh_api_search.js
CHANGED
|
@@ -43,6 +43,9 @@ $( document ).ready(function() {
|
|
|
43
43
|
});
|
|
44
44
|
|
|
45
45
|
$( document ).ajaxComplete(function( event, xhr, settings ) {
|
|
46
|
+
if (xhr.responseJSON.errors !== undefined)
|
|
47
|
+
return;
|
|
48
|
+
|
|
46
49
|
var items = xhr.responseJSON.items, blobOfText = "";
|
|
47
50
|
|
|
48
51
|
// no results? let people know.
|
|
@@ -29,7 +29,7 @@ module Jekyll
|
|
|
29
29
|
end
|
|
30
30
|
js_file = File.read(File.join(File.dirname(__FILE__), "gh_api_search.js"))
|
|
31
31
|
VALID_KEYS.each do |key|
|
|
32
|
-
js_file = js_file.sub
|
|
32
|
+
js_file = js_file.sub(/\{\{ #{key} \}\}/, @opts[key.to_sym].nil? ? "''" : "'#{key.strip}:#{@opts[key.to_sym].join(",")}'")
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
@js = Uglifier.compile(js_file)
|
|
@@ -41,8 +41,9 @@ module Jekyll
|
|
|
41
41
|
#{@js}
|
|
42
42
|
</script>
|
|
43
43
|
<div id="search">
|
|
44
|
-
<form action="
|
|
45
|
-
<input
|
|
44
|
+
<form action="javascript:null" method="get">
|
|
45
|
+
<input id="gh-pages-search-input" type="text" name="q" placeholder="Search" autocomplete="off">
|
|
46
|
+
<button id="gh-pages-search-button">Search</button>
|
|
46
47
|
</form>
|
|
47
48
|
</div>
|
|
48
49
|
EOS
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jekyll-github-pages-search
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0
|
|
4
|
+
version: 0.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Garen J. Torikian
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-02-
|
|
11
|
+
date: 2014-02-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: jekyll
|