smart_tag 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
data/lib/smart_tag/version.rb
CHANGED
@@ -1 +0,0 @@
|
|
1
|
-
(function($){$(document).ready(function(){function smart_tag(select){function in_array(array,value){for(var i=array.length-1;i>=0;i--){if(array[i]==value){return true}}return false}function get_options_text(options){var options_text=[];for(var i=options.length-1;i>=0;i--){var text=$(options[i]).text();if(!in_array(options_text,text)){options_text.push(text)}}return options_text}function add_tags(ul){var selected_options_text=get_options_text(select.children('option:selected'));ul.tagit("removeAll");for(var i=selected_options_text.length-1;i>=0;i--){ul.tagit("createTag",selected_options_text[i])}}function ul_to_selected(tags){for(var i=options.length-1;i>=0;i--){var option=$(options[i]);if(in_array(tags,option.text())){option.attr("selected",true)}else{option.attr("selected",false)}}}var options=select.children('option');var all_options_text=get_options_text(options);var ul=$('<ul class="'+select.attr('id')+'_smart_tag"></ul>');select.before(ul);ul.css({'margin-left':'0px','width':'488px'});ul.tagit({availableTags:all_options_text,afterTagAdded:function(event,ui){ul_to_selected(ul.tagit("assignedTags"))},afterTagRemoved:function(event,ui){ul_to_selected(ul.tagit("assignedTags"))}});add_tags(ul);select.change(function(){add_tags(ul)})}var selects=$(".smart_tag");for(var i=selects.length-1;i>=0;i--){smart_tag($(selects[i]))}})}(window.jQuery));
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smart_tag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-04-
|
12
|
+
date: 2013-04-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: jquery-ui-rails
|