jquery_textcomplete 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -8
- data/lib/jquery_textcomplete/version.rb +1 -1
- data/vendor/assets/stylesheets/jquery.textcomplete.scss +13 -17
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29ba5754a8d4933a065925e44d786e800023d1503c76c53d46311f596eee7bba
|
4
|
+
data.tar.gz: 64206715cbdd7fa44d552d809ec3c919c71980fb08de7ed174db7d8301125922
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c6d9bdae80a9d743a4d094fd47ff9021d43b47b0d56ac8a677fbcae0307433344153d3f96eeaed54013eb1a836c031398880a149b590a2163f1b468243fc074
|
7
|
+
data.tar.gz: 3446ae023e341af72faaca0f9b1bb5efb18af5dd6babfd91b1b06947db6f227e60f8b76ee2da1628d138eeca4ef90f02837e9c09f7c0f4fe37df00af2a371728
|
data/README.md
CHANGED
@@ -38,13 +38,13 @@ In views:
|
|
38
38
|
|
39
39
|
In `application.js`:
|
40
40
|
|
41
|
-
function
|
41
|
+
function addTextcompleteForHashtagsAndUsertags($textarea) {
|
42
42
|
$textarea.textcomplete([
|
43
43
|
{
|
44
|
-
//
|
45
|
-
match: /(\s|^)
|
44
|
+
// Hashtag strategy
|
45
|
+
match: /(\s|^)#(\w+)$/,
|
46
46
|
search: function (term, callback) {
|
47
|
-
$.getJSON('/
|
47
|
+
$.getJSON('/posts/autocomplete_hashtag', { query: term })
|
48
48
|
.done(function (resp) { callback(resp); })
|
49
49
|
.fail(function () { callback([]); });
|
50
50
|
},
|
@@ -53,10 +53,10 @@ In `application.js`:
|
|
53
53
|
}
|
54
54
|
},
|
55
55
|
{
|
56
|
-
//
|
57
|
-
match: /(\s|^)
|
56
|
+
// Usertag strategy
|
57
|
+
match: /(\s|^)@([^\s]+)$/,
|
58
58
|
search: function (term, callback) {
|
59
|
-
$.getJSON('/
|
59
|
+
$.getJSON('/users/autocomplete_usertag', { query: term })
|
60
60
|
.done(function (resp) { callback(resp); })
|
61
61
|
.fail(function () { callback([]); });
|
62
62
|
},
|
@@ -82,9 +82,10 @@ In `routes.rb`:
|
|
82
82
|
|
83
83
|
get 'autocomplete_usertag' => 'users#autocomplete_usertag', on: :collection
|
84
84
|
|
85
|
-
|
86
85
|
For more options and style customization, please, see [jQuery Textcomplete documentation](https://github.com/yuku-t/jquery-textcomplete).
|
87
86
|
|
87
|
+
To Note: z-index for dropdown is 100, therefore you must set z-index of surrounding elements below 100 if you want the textcomplete dropdown to appear above surrounding elements.
|
88
|
+
|
88
89
|
<!-- ## Development
|
89
90
|
|
90
91
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
@@ -1,5 +1,3 @@
|
|
1
|
-
// Sample
|
2
|
-
|
3
1
|
.dropdown-menu {
|
4
2
|
// maybe refactor and get rid of border here and in li
|
5
3
|
border: 1px solid #ddd;
|
@@ -11,40 +9,38 @@
|
|
11
9
|
margin: 0;
|
12
10
|
// end
|
13
11
|
|
14
|
-
// for mobile and tablet
|
15
|
-
@media (max-width: 768px) {
|
16
|
-
width: 70%;
|
17
|
-
overflow: auto;
|
18
|
-
}
|
19
|
-
|
20
12
|
li {
|
21
13
|
border-top: 1px solid #ddd;
|
22
|
-
padding: 2px 5px;
|
23
14
|
|
24
15
|
&:first-child {
|
25
16
|
border-top: none;
|
26
17
|
}
|
27
18
|
|
28
|
-
//
|
19
|
+
// hover in case there is a gap (i.e. padding) between li and a elements
|
29
20
|
&:hover, &.active {
|
30
|
-
background-color: #6eb7db;
|
31
21
|
|
32
|
-
//
|
22
|
+
// mainly (if there is no gap) for when cursor is not over a element (li is active)
|
33
23
|
a {
|
34
24
|
background-color: #6eb7db;
|
25
|
+
|
26
|
+
&:hover {
|
27
|
+
background-color: #6eb7db;
|
28
|
+
}
|
29
|
+
|
35
30
|
}
|
36
31
|
|
37
32
|
}
|
38
33
|
|
39
34
|
}
|
40
35
|
|
41
|
-
|
42
|
-
|
43
|
-
background-color: #6eb7db;
|
36
|
+
a:hover {
|
37
|
+
cursor: pointer; // SHOULD not modify
|
44
38
|
}
|
45
39
|
|
46
|
-
|
47
|
-
|
40
|
+
// for mobile and tablet
|
41
|
+
@media (max-width: 768px) {
|
42
|
+
width: 70%;
|
43
|
+
overflow: auto;
|
48
44
|
}
|
49
45
|
|
50
46
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jquery_textcomplete
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastian Peterlin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|