assoc_whisperer 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTAwMGQ0NTFkNTBlMTJjYWY0NzJlMjNhMzJiMWFjMmJhMDkyOTQ4Mg==
4
+ NDIyMjM5N2NmMmQ5ZWQ1YTQ1NDY0OWVjYmI3MzFlNDE2NzM4MzllZA==
5
5
  data.tar.gz: !binary |-
6
- MTM3OTM5N2UwZjM3NjZkMDJkMjQyMTk4YTMyZTBkMGEwOTA2ZDJlZg==
6
+ MjlhMDE5NmE1YzlhM2QzYzA2NjA5NjczYTY2OWQyOWJiNjYwMTk0Mg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OWI2Y2JkNTEzYWRkZDg2MzE4ZmQzMDE0MzVjOTkxYjdiOGU5ODU5MDE5ODNh
10
- MDIxMWJlOGQ3ZDJmODUxNGYxM2RlMTU1MDA4NjkyMWZiZGFiNzdkNWFmZmRj
11
- YjkxM2RhZTQzMGRkMzQ4MTJhMmE3ZGI5ODM0ZTdmZWZiMDMxNDY=
9
+ ZDQzOGQ1MmYxYjY5MjNhZjM0MjM1NTFkNWZiZWRkNjQ5ZDQzMGJkMWNiZjFi
10
+ NmE1ZWViZTBjNGExMDYxMjgyNzU2ZmMyNWE4ZmU0MTZlNWJjNTQwYWMxNDUz
11
+ NGYyMGRlZWRmZmJlOTk0NDhhNzVlMDJlMDFlNWM1MGNlM2ZhNGY=
12
12
  data.tar.gz: !binary |-
13
- YzkxYmVjOTkzZmI5NTc5OGZkODhkZjRhMzUyOWYyOTE4MWYwMDU4NzU5ZmYx
14
- YzViMmUwZTEwM2JhZTYxMjNjMjM0OGYwZWQwZjE3YmE3ZDgzMGEzYTNhNzVh
15
- OGM3MjQwNzM5ZjYwMzM4ZDc0NmUwODI3NDAwMTQwNzEyOWJlYjc=
13
+ OWVlMGQ0MGU0MjQ2M2M3YmNhZjVlYjVlOWYwZWVmZmQzMjk2MjRiYzQyYzI1
14
+ YzZiMjBkZDYyZjQ3YTdhNTY5NmY4YzJkNWJmODA5YzQ3NmZjODA0OTIzMTFk
15
+ NGI1YWYxMWRlY2E4NWI1Y2UyNmMzYmIwMDgyMDU3YmFiOTE3NzQ=
@@ -14,8 +14,8 @@ Gem::Specification.new do |spec|
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0")
17
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
17
+ # spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ # spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_development_dependency "bundler"
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
  module AssocWhisperer
3
- VERSION = "1.0.3"
3
+ VERSION = "1.0.4"
4
4
 
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: assoc_whisperer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ondřej Želazko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-26 00:00:00.000000000 Z
11
+ date: 2014-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -51,8 +51,7 @@ files:
51
51
  - LICENSE.txt
52
52
  - README.md
53
53
  - Rakefile
54
- - app/assets/javascript/assoc_whisp.min.js
55
- - app/assets/javascript/assoc_whispering.coffee
54
+ - app/assets/javascripts/assoc_whisp.coffee
56
55
  - app/assets/stylesheets/assoc_whisp_example.css
57
56
  - app/helpers/action_view/helpers/assoc_whisperer_helper.rb
58
57
  - app/helpers/action_view/helpers/tags/assoc_whisperer_field.rb
@@ -1 +0,0 @@
1
- (function(){var e,t=function(e,t){return function(){return e.apply(t,arguments)}};document.AssocWhispering={all:[],working:false,find:function(e){var t,n,r,i;i=document.AssocWhispering.all;for(n=0,r=i.length;n<r;n++){t=i[n];if(t._action===e){return t}}return null},selectTextFor:function(e,t){var n;n=document.AssocWhispering.find(t);n._last_input="§";return n.getList("",false,function(){return n.selectText(e)})},selectValueFor:function(e,t){var n;n=document.AssocWhispering.find(t);n._last_input="§";return n.getList("",false,function(){switch(e){case"#1":return n.select(n._list_tag.find("div:first"));default:return n.selectValue(e)}})}};$(document).ready(function(){return $(".assoc_whisperer").each(function(t,n){var r;r=new e(n);return document.AssocWhispering.all.push(r)})});e=function(){function e(e){this.setUnfilled=t(this.setUnfilled,this);this.selectText=t(this.selectText,this);this.selectValue=t(this.selectValue,this);this.select=t(this.select,this);this.removeList=t(this.removeList,this);this.deactivateList=t(this.deactivateList,this);this.showList=t(this.showList,this);this.getList=t(this.getList,this);this.controls_blur=t(this.controls_blur,this);this.dropdown_button_click=t(this.dropdown_button_click,this);this.text_field_keyup=t(this.text_field_keyup,this);this._tag=$(e);this._action=this._tag.attr("data-action");this._url=this._tag.attr("data-url");this._text_field=this._tag.children(".text_field");this._value_field=this._tag.children(".value_field");this._text_field.keyup(this.text_field_keyup);this._text_field.click(function(e){return function(){return e._text_field.select()}}(this));this._text_field.focus(function(e){return function(){return e._focus="text_field"}}(this));this._text_field.blur(this.controls_blur);this._tag.children(".dropdown_button").click(this.dropdown_button_click);this._is_filled=this._value_field.val()!==""}e.prototype._tag=null;e.prototype._text_field=null;e.prototype._value_field=null;e.prototype._list_tag=null;e.prototype._action=null;e.prototype._url=null;e.prototype._timeout=null;e.prototype._last_input="§";e.prototype._is_filled=false;e.prototype._focus=null;e.prototype.text_field_keyup=function(e){var t,n;if(e.keyCode===40){return}else if(e.keyCode===27){this.removeList();return}n=this._text_field.val();if(this._timeout){clearTimeout(this._timeout)}if(n!==this._last_input&&this._is_filled){this.setUnfilled()}if(n===""){this._last_input=n;return this.removeList()}else{t=function(e){return function(){return e.getList(n)}}(this);return this._timeout=setTimeout(t,700)}};e.prototype.dropdown_button_click=function(){var hold_last;hold_last=this._last_input;this._last_input="§";if(this._is_filled){this.getList("",true);return this._last_input=hold_last;}else{return this.getList(this._text_field.val(),true)}};e.prototype.controls_blur=function(){this._focus=null;return setTimeout(function(e){return function(){if(!e._focus){return e.removeList()}}}(this),100)};e.prototype.getList=function(e,t,n){if(t==null){t=false}if(n==null){n=null}if(e===this._last_input){return}this._last_input=e;this.deactivateList();document.AssocWhispering.working=true;return $.ajax(this._tag.attr("data-url"),{type:"GET",dataType:"html",data:{data_action:this._tag.attr("data-action"),input:e},error:this.removeList,success:function(e){return function(r){e.showList(r);if(t){e._list_tag.focus()}if(n){n()}return document.AssocWhispering.working=false}}(this)})};e.prototype.showList=function(e){var t;this.removeList();this._list_tag=$(e);this._list_tag.css("min-width",this._tag.width());this._list_tag.css("left",this._tag.offset().left);this._list_tag.css("top",this._tag.position().top+this._tag.outerHeight());this._tag.append(this._list_tag);this._list_tag.focus(function(e){return function(){return e._focus="list"}}(this));this._list_tag.blur(this.controls_blur);t=this._list_tag.find("div");return t.click(function(e){return function(t){return e.select($(t.currentTarget))}}(this))};e.prototype.deactivateList=function(){if(!this._list_tag){return}return this._list_tag.addClass("inactive")};e.prototype.removeList=function(){if(!this._list_tag){return}this._list_tag.detach();return this._list_tag=null};e.prototype.select=function(e){var t;if(e.length!==1){return}t=e.text();this._text_field.val(t);this._value_field.val(e.attr("data-value"));this._last_input=t;this._is_filled=true;this._text_field.removeClass("unfilled");return this.removeList()};e.prototype.selectValue=function(e){return this.select(this._list_tag.find("div[data-value="+e+"]"))};e.prototype.selectText=function(e){return this.select(this._list_tag.find('div:contains("'+e+'")'))};e.prototype.setUnfilled=function(){this._is_filled=false;this._value_field.val("");return this._text_field.addClass("unfilled")};return e}()}).call(this)