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: 649a45aebd28ba28334d070736fb03f2af7db3df
4
- data.tar.gz: 2d05345c7c542fc745a962427a2bb609de5650ad
3
+ metadata.gz: eaafd3ee80684a0e50c1b6760b82b4885e9b25db
4
+ data.tar.gz: 5959d18b703561a3d7349f4340bd2b05425c43c4
5
5
  SHA512:
6
- metadata.gz: ffa464ef6d94af46886f63ab339f64cc2241d5b03bfe3a2ef1663e21391978e9d81918d527942cda48803de145a83501af7ca903795c01b9d68ce099b7fa6a3f
7
- data.tar.gz: a98c3894e761a6c2f908dd32d9a9e7fc6485f37dcb5f9b8d88788dbbad827235473ea7ec53c6556170a30dfecb813af6147073c504ebb3424a935d1a64bb6fbd
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
- gem 'popcircle', github: 'jakehockey10/popcircle'
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
- //= require popcircle/popcircle
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
- <%= popcircle(images: %w(one.png two.png three.png four.png five.png)) %>
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/[USERNAME]/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.
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 "bundler/gem_tasks"
2
- require "rake/testtask"
1
+ require 'bundler/gem_tasks'
2
+ require 'rake/testtask'
3
3
 
4
4
  Rake::TestTask.new(:test) do |t|
5
- t.libs << "test"
6
- t.libs << "lib"
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-trigger').click(function (e) {
10
- e.preventDefault();
11
- $.popcircle('#pops', {
12
- spacing: '10px',
13
- type: 'full', // full, half, quad
14
- offset: 1.95, // 0, 1, 2, 3, 4, 5, 6, 7, or 5.1
15
- ease: 'easeOutElastic',
16
- time: 'slow' // slow, fast, 1000
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
+ });
@@ -40,4 +40,15 @@
40
40
  height: 100px;
41
41
  width: 100px;
42
42
  position: absolute;
43
+ }
44
+
45
+ .popcircle > ul > li > a {
46
+ display: table;
47
+ height: 100%;
48
+ text-decoration: none;
49
+ margin: auto;
50
+ i {
51
+ display: table-cell;
52
+ vertical-align: middle;
53
+ }
43
54
  }
@@ -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] ||= 'pops'
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, id: options[:list] do
29
+ content_tag :ul, class: options[:list] do
31
30
  circles.each do |circle|
32
31
  concat list_item(circle)
33
32
  end
@@ -2,6 +2,6 @@ module Popcircle
2
2
  module Rails
3
3
  EASING_VERSION = '1.4.0'
4
4
  POPCIRCLE_VERSION = '1.0'
5
- VERSION = '0.1.0'
5
+ VERSION = '0.2.0'
6
6
  end
7
7
  end
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.1.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-24 00:00:00.000000000 Z
11
+ date: 2016-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails