jquery-atwho-rails 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -4,7 +4,7 @@ bind your textarea
4
4
 
5
5
  ```javascript
6
6
  data = ['tom','john'];
7
- $('textarea').atwho("@",{'data':data});
7
+ $('textarea').atWho("@",{'data':data});
8
8
  ```
9
9
 
10
10
  that's it, check it out!
@@ -124,7 +124,7 @@
124
124
  var match, search_word;
125
125
  search_word = this.search_word[this.theflag];
126
126
  if (search_word) return search_word;
127
- match = /data-value=['?]\$\{(\w+)\}/g.exec(this.getOpt('tpl'));
127
+ match = /data-value=["']?\$\{(\w+)\}/g.exec(this.getOpt('tpl'));
128
128
  return this.search_word[this.theflag] = !_isNil(match) ? match[1] : null;
129
129
  },
130
130
  getOpt: function(key) {
@@ -207,7 +207,7 @@
207
207
  regexp = new RegExp(flag + '([A-Za-z0-9_\+\-]*)$|' + flag + '([^\\x00-\\xff]*)$', 'gi');
208
208
  match = regexp.exec(subtext);
209
209
  if (!_isNil(match)) {
210
- matched = match[1] === 'undefined' ? match[2] : match[1];
210
+ matched = match[1] === void 0 ? match[2] : match[1];
211
211
  _this.theflag = flag;
212
212
  return false;
213
213
  }
@@ -400,6 +400,10 @@
400
400
  render: function(holder, list) {
401
401
  var $ul, tpl;
402
402
  if (!$.isArray(list)) return false;
403
+ if (list.length <= 0) {
404
+ this.hide();
405
+ return true;
406
+ }
403
407
  this.holder = holder;
404
408
  holder.cache(list);
405
409
  this.clear();
@@ -504,6 +508,7 @@
504
508
  })(window.jQuery);
505
509
 
506
510
 
511
+
507
512
  /* 本插件操作 textarea 或者 input 内的插入符
508
513
  * 只实现了获得插入符在文本框中的位置,我设置
509
514
  * 插入符的位置.
@@ -1,7 +1,7 @@
1
1
  module Jquery
2
2
  module Atwho
3
3
  module Rails
4
- VERSION = "0.1.4"
4
+ VERSION = "0.1.5"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jquery-atwho-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-05 00:00:00.000000000 Z
12
+ date: 2012-04-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: !ruby/object:Gem::Requirement
16
+ requirement: &77809630 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,15 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
29
- version: '0'
24
+ version_requirements: *77809630
30
25
  - !ruby/object:Gem::Dependency
31
26
  name: generator_spec
32
- requirement: !ruby/object:Gem::Requirement
27
+ requirement: &77809240 !ruby/object:Gem::Requirement
33
28
  none: false
34
29
  requirements:
35
30
  - - ! '>='
@@ -37,12 +32,7 @@ dependencies:
37
32
  version: '0'
38
33
  type: :development
39
34
  prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ! '>='
44
- - !ruby/object:Gem::Version
45
- version: '0'
35
+ version_requirements: *77809240
46
36
  description: ! "This is a jQuery plugin \n that implement Twitter/Weibo like @
47
37
  mentions."
48
38
  email:
@@ -83,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
73
  version: '0'
84
74
  requirements: []
85
75
  rubyforge_project: jquery-atwho-rails
86
- rubygems_version: 1.8.19
76
+ rubygems_version: 1.8.17
87
77
  signing_key:
88
78
  specification_version: 3
89
79
  summary: ! 'jquery plugin: @mentions'