jquery_textcomplete 0.2.0 → 0.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9608a815a01dc42935d2c4dcf5b1dd837ede6de1527b8d8322a4c4061a384bdb
4
- data.tar.gz: 5ecce119c35a1425d58c05fd915ad937fd5d8dc353286f907dd764e98002b4d5
3
+ metadata.gz: 29ba5754a8d4933a065925e44d786e800023d1503c76c53d46311f596eee7bba
4
+ data.tar.gz: 64206715cbdd7fa44d552d809ec3c919c71980fb08de7ed174db7d8301125922
5
5
  SHA512:
6
- metadata.gz: 8a08622e5d436c884ff2d0102f3c1e06640a6cd51811bde5cb3cb82af62f16fa60944e5824770aca608a3572e6b7548af60b1f14e52d7bc51da579e62123c859
7
- data.tar.gz: 04a5285af0f0206ce9b95e7436282bf44f90df9c741b590c8dfb9ab5f9b1031bf614da9f63e02022e49265e6f379319e067f1f009701caad0e0406deb78c326a
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 addTextCompleteForHashtagsAndUsertags($textarea) {
41
+ function addTextcompleteForHashtagsAndUsertags($textarea) {
42
42
  $textarea.textcomplete([
43
43
  {
44
- // Usertag strategy
45
- match: /(\s|^)@([^\s]+)$/,
44
+ // Hashtag strategy
45
+ match: /(\s|^)#(\w+)$/,
46
46
  search: function (term, callback) {
47
- $.getJSON('/users/autocomplete_usertag', { query: term })
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
- // Hashtag strategy
57
- match: /(\s|^)#(\w+)$/,
56
+ // Usertag strategy
57
+ match: /(\s|^)@([^\s]+)$/,
58
58
  search: function (term, callback) {
59
- $.getJSON('/posts/autocomplete_hashtag', { query: term })
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,3 +1,3 @@
1
1
  module JqueryTextcomplete
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -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
- // refactor, for when cursor is over li element or li element is active, would like to get rid of gap between li and a and not have 3 repeats of same background-color
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
- // for when cursor is not over a element but li element has cursor over it or is active and still want a element highlighted, only need this (and li.textcomplete-item a:hover) since there is a gap between li and a elements
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
- // maybe refactor, for when cursor is over a element, only way to get it to work without using !important
42
- li.textcomplete-item a:hover {
43
- background-color: #6eb7db;
36
+ a:hover {
37
+ cursor: pointer; // SHOULD not modify
44
38
  }
45
39
 
46
- a:hover {
47
- cursor: pointer; // SHOULD not modify
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.0
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-18 00:00:00.000000000 Z
11
+ date: 2018-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler