popcircle 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eaafd3ee80684a0e50c1b6760b82b4885e9b25db
|
4
|
+
data.tar.gz: 5959d18b703561a3d7349f4340bd2b05425c43c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d317e03ac59ec2ef1c754dced24f57f0ccd8cc25d75755f6fa07c36a5e464dc15309f48935b070f5251c169a3cc9b4c52ac8e0c457b1f640806d0a359388d922
|
7
|
+
data.tar.gz: 4462057a7952ed4aff147d9142301bea32645a57a29b96141f4dfbf41b33d79b5800af64bb900c5e21525bb66aedb77bf03c7f57185a3bf3a3a081f8ed102aaa
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Popcircle
|
2
2
|
|
3
|
+
![](https://img.shields.io/gem/dt/popcircle.svg)
|
4
|
+
|
3
5
|
![Alt text](/popcircle.gif)
|
4
6
|
|
5
7
|
This gem adds `jquery.easing` and `jquery.popcircle` to your application and provides a view helper to add a radial menu with images or icons as the links surrounding the main trigger.
|
@@ -9,7 +11,7 @@ This gem adds `jquery.easing` and `jquery.popcircle` to your application and pro
|
|
9
11
|
Add this line to your application's Gemfile:
|
10
12
|
|
11
13
|
```ruby
|
12
|
-
|
14
|
+
gem 'popcircle'
|
13
15
|
```
|
14
16
|
|
15
17
|
And then execute:
|
@@ -25,34 +27,38 @@ Or install it yourself as:
|
|
25
27
|
First, make sure your `application.js` file includes the following:
|
26
28
|
|
27
29
|
```javascript
|
28
|
-
|
30
|
+
//= require popcircle/popcircle
|
29
31
|
```
|
30
32
|
|
31
33
|
Second, you can include something like this in your `HTML`
|
32
34
|
|
33
35
|
```HTML
|
34
|
-
|
36
|
+
<%= popcircle(images: %w(one.png two.png three.png four.png five.png)) %>
|
35
37
|
```
|
36
38
|
|
37
39
|
## TODO
|
38
40
|
|
39
|
-
- More than one popcircle makes the click handler not work.
|
40
41
|
- Get helper tests back to running
|
41
42
|
- improve helper method
|
42
43
|
- allow trigger background image to be configurable
|
43
44
|
- allow size to be configurable
|
44
|
-
- make icons line up
|
45
45
|
|
46
46
|
## Contributing
|
47
47
|
|
48
48
|
I could use some help!
|
49
49
|
|
50
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
50
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/jakehockey10/popcircle. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
51
51
|
|
52
52
|
## Development
|
53
53
|
|
54
54
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
55
55
|
|
56
|
+
#### Note
|
57
|
+
|
58
|
+
I have begun the development of this app with integration tests in a dummy rails app inside the test folder of the gem's project. The integration tests in this rails app should be run from the root of the project.
|
59
|
+
|
60
|
+
#### Installing
|
61
|
+
|
56
62
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
57
63
|
|
58
64
|
## License
|
data/Rakefile
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require 'bundler/gem_tasks'
|
2
|
+
require 'rake/testtask'
|
3
3
|
|
4
4
|
Rake::TestTask.new(:test) do |t|
|
5
|
-
t.libs <<
|
6
|
-
t.libs <<
|
5
|
+
t.libs << 'test'
|
6
|
+
t.libs << 'lib'
|
7
7
|
t.test_files = FileList['test/**/*_test.rb']
|
8
8
|
end
|
9
9
|
|
@@ -1,19 +1,28 @@
|
|
1
|
-
// app/assets/javascripts/popcircle.js
|
2
|
-
//
|
3
1
|
// jQuery Popcircle setup for popcircle helpers
|
4
2
|
//
|
5
3
|
//= require jquery.easing
|
6
4
|
//= require jquery.popcircle
|
7
5
|
|
8
6
|
$(document).on('turbolinks:load', function () {
|
9
|
-
$('.popcircle-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
7
|
+
$.each($('.popcircle-list'), function (index, value) {
|
8
|
+
$(this).closest('.popcircle-box').find('.popcircle-trigger').on('click', function (e) {
|
9
|
+
e.preventDefault();
|
10
|
+
var newClass = 'popcircle-' + index;
|
11
|
+
$(value).removeClass('popcircle-list').addClass(newClass);
|
12
|
+
$.popcircle('.' + newClass, {
|
13
|
+
spacing: '10px',
|
14
|
+
type: 'full', // full, half, quad
|
15
|
+
offset: 1.95, // 0, 1, 2, 3, 4, 5, 6, 7, or 5.1
|
16
|
+
ease: 'easeOutElastic',
|
17
|
+
time: 'slow' // slow, fast, 1000
|
18
|
+
});
|
17
19
|
});
|
20
|
+
// $.popcircle('.popcircle-list', {
|
21
|
+
// spacing: '10px',
|
22
|
+
// type: 'full', // full, half, quad
|
23
|
+
// offset: 1.95, // 0, 1, 2, 3, 4, 5, 6, 7, or 5.1
|
24
|
+
// ease: 'easeOutElastic',
|
25
|
+
// time: 'slow' // slow, fast, 1000
|
26
|
+
// });
|
18
27
|
});
|
19
|
-
});
|
28
|
+
});
|
@@ -5,7 +5,6 @@ module Popcircle
|
|
5
5
|
include FontAwesome::Rails::IconHelper
|
6
6
|
|
7
7
|
def popcircle(circles, options = {})
|
8
|
-
# options = circles.length > 1 ? circles.extract_options! : {}
|
9
8
|
raise Exception.new('Argument `circles` not a Hash...') unless circles.is_a? Hash
|
10
9
|
|
11
10
|
if circles[:icons]
|
@@ -13,7 +12,7 @@ module Popcircle
|
|
13
12
|
elsif circles[:images]
|
14
13
|
circles = circles[:images].map { |circle| { image: circle } }
|
15
14
|
end
|
16
|
-
options[:list] ||= '
|
15
|
+
options[:list] ||= 'popcircle-list'
|
17
16
|
content_tag :div, class: 'popcircle-box' do
|
18
17
|
trigger + list(circles, options)
|
19
18
|
end if circles
|
@@ -27,7 +26,7 @@ module Popcircle
|
|
27
26
|
|
28
27
|
def list(circles, options)
|
29
28
|
content_tag :div, class: 'popcircle' do
|
30
|
-
content_tag :ul,
|
29
|
+
content_tag :ul, class: options[:list] do
|
31
30
|
circles.each do |circle|
|
32
31
|
concat list_item(circle)
|
33
32
|
end
|
data/lib/popcircle/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: popcircle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jake Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|