taggle 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,6 @@
1
+ //
2
+ // Unofficial set of styles based on the official examples of the Taggle.js project
3
+ //
4
+ // Author: @hsgubert - Henrique Gubert
5
+ // Based on the examples developed by @okcoker - Sean Coker
6
+ //*= require_tree ./taggle
@@ -0,0 +1,58 @@
1
+ //
2
+ // Unofficial set of styles based on the official examples of the Taggle.js project
3
+ //
4
+ // Author: @hsgubert - Henrique Gubert
5
+ // Based on the examples developed by @okcoker - Sean Coker
6
+
7
+
8
+ div.taggle {
9
+ // jQuery autocomplete example
10
+ .ui-autocomplete {
11
+ position: absolute;
12
+ top: 0;
13
+ left: 0;
14
+ }
15
+
16
+ .ui-menu {
17
+ list-style: none;
18
+ padding: 2px;
19
+ margin: 0;
20
+ display: block;
21
+ outline: none;
22
+ }
23
+
24
+ .ui-menu .ui-menu-item {
25
+ margin: 0;
26
+ padding: 0;
27
+ width: 100%;
28
+ }
29
+
30
+ .ui-menu .ui-menu-item a {
31
+ text-decoration: none;
32
+ display: block;
33
+ padding: 2px .4em;
34
+ line-height: 1.5;
35
+ min-height: 0;
36
+ font-weight: normal;
37
+ color: #8a8a8a;
38
+ cursor: pointer;
39
+
40
+ &:hover {
41
+ color: #fff;
42
+ background: #990033;
43
+ }
44
+ }
45
+
46
+
47
+ .ui-helper-hidden-accessible {
48
+ border: 0;
49
+ clip: rect(0 0 0 0);
50
+ height: 1px;
51
+ margin: -1px;
52
+ overflow: hidden;
53
+ padding: 0;
54
+ position: absolute;
55
+ width: 1px;
56
+ }
57
+
58
+ }
@@ -0,0 +1,127 @@
1
+ //
2
+ // Unofficial set of styles based on the official examples of the Taggle.js project
3
+ //
4
+ // Author: @hsgubert - Henrique Gubert
5
+ // Based on the examples developed by @okcoker - Sean Coker
6
+
7
+
8
+ div.taggle {
9
+ border: 0;
10
+ background: #FDFDFD;
11
+ box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2), 0 1px 1px rgba(255, 255, 255, 0.7);
12
+ min-height: 20px;
13
+ padding: 8px;
14
+ border-radius: 3px;
15
+ color: #555;
16
+ transition: all .25s;
17
+ cursor: text;
18
+ margin-bottom: 10px;
19
+ position: relative;
20
+ height: auto;
21
+
22
+ span.taggle_placeholder {
23
+ position: absolute;
24
+ color: #CCC;
25
+ top: 12px;
26
+ left: 8px;
27
+ transition: opacity, .25s;
28
+ user-select: none;
29
+ }
30
+
31
+ // clearfix: makes div expand as more tags are added
32
+ &:before, &:after {
33
+ display: block;
34
+ content: "";
35
+ line-height: 0;
36
+ clear: both;
37
+ }
38
+
39
+ ul.taggle_list {
40
+ float: left;
41
+ width: 100%;
42
+
43
+ li.taggle {
44
+ margin-right: 8px;
45
+ margin-bottom: 0px;
46
+ background: #E2E1DF;
47
+ padding: 5px 10px;
48
+ border-radius: 3px;
49
+ position: relative;
50
+ cursor: pointer;
51
+ transition: all .3s;
52
+ animation-duration: 1s;
53
+ animation-fill-mode: both;
54
+
55
+ &:hover {
56
+ padding: 5px;
57
+ padding-right: 15px;
58
+ background: #ccc;
59
+ transition: all .3s;
60
+
61
+ button.close {
62
+ display: block;
63
+ }
64
+ }
65
+
66
+ button.close {
67
+ font-size: 1.1rem;
68
+ position: absolute;
69
+ top: 5px;
70
+ right: 3px;
71
+ text-decoration: none;
72
+ padding-left: 2px;
73
+ padding-top: 3px;
74
+ line-height: 0.5;
75
+ color: #ccc;
76
+ color: rgba(0, 0, 0, 0.2);
77
+ padding-bottom: 4px;
78
+ display: none;
79
+ border: 0;
80
+ background: none;
81
+ cursor: pointer;
82
+
83
+ &:hover {
84
+ color: #990033;
85
+ }
86
+ }
87
+ }
88
+
89
+ li {
90
+ float: left;
91
+ display: inline-block;
92
+ white-space: nowrap;
93
+ font-weight: 500;
94
+ margin-bottom: 0px;
95
+ }
96
+
97
+ .taggle_hot {
98
+ background: #cac8c4;
99
+ }
100
+ }
101
+
102
+ .taggle_sizer {
103
+ padding: 0;
104
+ margin: 0;
105
+ position: absolute;
106
+ top: -500px;
107
+ z-index: -1;
108
+ visibility: hidden;
109
+ }
110
+
111
+ input.taggle_input {
112
+ border: none;
113
+ outline: none;
114
+ padding: 8px;
115
+ padding-left: 0;
116
+ float: left;
117
+ margin-top: -5px;
118
+ background: none;
119
+ width: 100%;
120
+ max-width: 100%;
121
+
122
+ &:focus, &.active {
123
+ background: #fff;
124
+ transition: all .25s;
125
+ }
126
+ }
127
+ }
@@ -0,0 +1,96 @@
1
+ //
2
+ // Unofficial set of styles based on the official examples of the Taggle.js project
3
+ //
4
+ // Author: @hsgubert - Henrique Gubert
5
+ // Based on the examples developed by @okcoker - Sean Coker
6
+
7
+ div.taggle {
8
+ &.custom {
9
+ border-radius: 0;
10
+ box-shadow: none;
11
+
12
+ .taggle {
13
+ border-radius: 0;
14
+ padding: 5px;
15
+ padding-right: 20px;
16
+
17
+ .close {
18
+ display: inline-block;
19
+ right: 3px;
20
+ }
21
+ }
22
+
23
+ // Delicious style
24
+ &.delicious {
25
+ background-image: linear-gradient(to bottom,#eee 1%,#fff 15%);
26
+ border: 1px solid #AAA;
27
+ min-height: 50px;
28
+
29
+ &.active {
30
+ border-color: #3274D1;
31
+ background-image: linear-gradient(to bottom,#eee 1%,#fff 15%);
32
+ }
33
+
34
+ .taggle {
35
+ color: #444;
36
+ border-radius: 0;
37
+ border-top-left-radius: 1.5rem;
38
+ border-bottom-left-radius: 1.5rem;
39
+ background-color: #ddd;
40
+ font-family: sans-serif;
41
+ font-size: 0.8rem;
42
+ padding: 5px;
43
+ padding-left: 20px;
44
+
45
+ .close {
46
+ color: #aaa;
47
+ font-size: 0.9rem;
48
+ height: 0.7rem;
49
+ width: 0.7rem;
50
+ line-height: .1rem;
51
+ margin-top: 3px;
52
+ right: auto;
53
+ left: 5px;
54
+
55
+ &:hover {
56
+ color: #888;
57
+ }
58
+ }
59
+ }
60
+ }
61
+
62
+ // StackOverflow style
63
+ &.stackoverflow {
64
+ border: 1px solid #ccc;
65
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
66
+
67
+ .taggle {
68
+ color: #3E6D8E;
69
+ border-radius: 0;
70
+ background-color: #E0EAF1;
71
+ font-weight: 200;
72
+
73
+ &.taggle_hot {
74
+ background: #BDD0DD;
75
+ }
76
+
77
+ .close {
78
+ color: #aaa;
79
+ border-radius: 0.7rem;
80
+ font-size: 0.9rem;
81
+ height: 0.7rem;
82
+ width: 0.7rem;
83
+ line-height: .1rem;
84
+ margin-top: 3px;
85
+
86
+ &:hover {
87
+ background: #C03434;
88
+ color: #fff;
89
+ }
90
+ }
91
+ }
92
+ }
93
+
94
+ // Other custom styles here
95
+ }
96
+ }
@@ -0,0 +1,81 @@
1
+ //
2
+ // Unofficial set of styles based on the official examples of the Taggle.js project
3
+ //
4
+ // Author: @hsgubert - Henrique Gubert
5
+ // Based on the examples developed by @okcoker - Sean Coker
6
+
7
+ div.taggle {
8
+ // Bounce animation
9
+ .bounce {
10
+ animation-name: bounce;
11
+ }
12
+
13
+ @-webkit-keyframes bounce {
14
+
15
+ 0%, 20%, 50%, 80%, 100% {
16
+ -webkit-transform: translateY(0);
17
+ }
18
+
19
+
20
+ 40% {
21
+ -webkit-transform: translateY(-16px);
22
+ }
23
+
24
+
25
+ 60% {
26
+ -webkit-transform: translateY(-7px);
27
+ }
28
+ }
29
+
30
+ @-moz-keyframes bounce {
31
+
32
+ 0%, 20%, 50%, 80%, 100% {
33
+ -moz-transform: translateY(0);
34
+ }
35
+
36
+
37
+ 40% {
38
+ -moz-transform: translateY(-16px);
39
+ }
40
+
41
+
42
+ 60% {
43
+ -moz-transform: translateY(-7px);
44
+ }
45
+ }
46
+
47
+ @-o-keyframes bounce {
48
+
49
+ 0%, 20%, 50%, 80%, 100% {
50
+ -o-transform: translateY(0);
51
+ }
52
+
53
+
54
+ 40% {
55
+ -o-transform: translateY(-16px);
56
+ }
57
+
58
+
59
+ 60% {
60
+ -o-transform: translateY(-7px);
61
+ }
62
+ }
63
+
64
+ @keyframes bounce {
65
+
66
+ 0%, 20%, 50%, 80%, 100% {
67
+ transform: translateY(0);
68
+ }
69
+
70
+
71
+ 40% {
72
+ transform: translateY(-16px);
73
+ }
74
+
75
+
76
+ 60% {
77
+ transform: translateY(-7px);
78
+ }
79
+ }
80
+
81
+ }
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "taggle"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/lib/taggle.rb ADDED
@@ -0,0 +1,7 @@
1
+ require "taggle/version"
2
+
3
+ # requires the Rails engine, that automatically includes the assets on the app
4
+ require "taggle/engine"
5
+
6
+ module Taggle
7
+ end
@@ -0,0 +1,5 @@
1
+ # Defining the engine automatically includes the assets on the apps
2
+ module Taggle
3
+ class Engine < Rails::Engine
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ module Taggle
2
+ VERSION = "0.1.0"
3
+ end
data/taggle.gemspec ADDED
@@ -0,0 +1,35 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'taggle/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "taggle"
8
+ spec.version = Taggle::VERSION
9
+ spec.date = '2016-09-20'
10
+ spec.authors = ["Henrique Gubert"]
11
+ spec.email = ["guberthenrique@hotmail.com"]
12
+
13
+ spec.summary = %q{Wrapper gem for the Taggle.js project}
14
+ spec.description = %q{This gem allows you to include Taggle.js in your Rails app, using the asset pipeline.}
15
+ spec.homepage = "https://github.com/hsgubert/taggle"
16
+ spec.license = "MIT"
17
+
18
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
19
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
20
+ # if spec.respond_to?(:metadata)
21
+ # spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
22
+ # else
23
+ # raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
24
+ # end
25
+
26
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
27
+ spec.bindir = "exe"
28
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
+ spec.require_paths = ["lib"]
30
+
31
+ spec.add_runtime_dependency 'rails', '>= 3.2'
32
+ spec.add_development_dependency "bundler", "~> 1.12"
33
+ spec.add_development_dependency "rake", "~> 10.0"
34
+ spec.add_development_dependency "rspec", "~> 3.0"
35
+ end