bootstrap-colorpicker2-rails 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +17 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +51 -0
  6. data/Rakefile +1 -0
  7. data/bootstrap-colorpicker2-rails.gemspec +25 -0
  8. data/lib/bootstrap-colorpicker2-rails.rb +1 -0
  9. data/lib/bootstrap/colorpicker2/rails/engine.rb +10 -0
  10. data/lib/bootstrap/colorpicker2/rails/version.rb +7 -0
  11. data/test/colorpicker2_rails_test/.gitignore +16 -0
  12. data/test/colorpicker2_rails_test/Gemfile +49 -0
  13. data/test/colorpicker2_rails_test/README.rdoc +28 -0
  14. data/test/colorpicker2_rails_test/Rakefile +6 -0
  15. data/test/colorpicker2_rails_test/app/assets/images/.keep +0 -0
  16. data/test/colorpicker2_rails_test/app/assets/javascripts/application.js +17 -0
  17. data/test/colorpicker2_rails_test/app/assets/javascripts/page.js.coffee +3 -0
  18. data/test/colorpicker2_rails_test/app/assets/stylesheets/application.css +13 -0
  19. data/test/colorpicker2_rails_test/app/assets/stylesheets/custom.css.scss +2 -0
  20. data/test/colorpicker2_rails_test/app/assets/stylesheets/page.css.scss +3 -0
  21. data/test/colorpicker2_rails_test/app/controllers/application_controller.rb +5 -0
  22. data/test/colorpicker2_rails_test/app/controllers/concerns/.keep +0 -0
  23. data/test/colorpicker2_rails_test/app/controllers/pages_controller.rb +26 -0
  24. data/test/colorpicker2_rails_test/app/helpers/application_helper.rb +2 -0
  25. data/test/colorpicker2_rails_test/app/helpers/page_helper.rb +2 -0
  26. data/test/colorpicker2_rails_test/app/mailers/.keep +0 -0
  27. data/test/colorpicker2_rails_test/app/models/.keep +0 -0
  28. data/test/colorpicker2_rails_test/app/models/concerns/.keep +0 -0
  29. data/test/colorpicker2_rails_test/app/models/page.rb +2 -0
  30. data/test/colorpicker2_rails_test/app/views/layouts/application.html.erb +14 -0
  31. data/test/colorpicker2_rails_test/app/views/pages/new.html.erb +19 -0
  32. data/test/colorpicker2_rails_test/app/views/pages/show.html.erb +3 -0
  33. data/test/colorpicker2_rails_test/bin/bundle +3 -0
  34. data/test/colorpicker2_rails_test/bin/rails +4 -0
  35. data/test/colorpicker2_rails_test/bin/rake +4 -0
  36. data/test/colorpicker2_rails_test/config.ru +4 -0
  37. data/test/colorpicker2_rails_test/config/application.rb +25 -0
  38. data/test/colorpicker2_rails_test/config/boot.rb +4 -0
  39. data/test/colorpicker2_rails_test/config/database.yml +25 -0
  40. data/test/colorpicker2_rails_test/config/environment.rb +5 -0
  41. data/test/colorpicker2_rails_test/config/environments/development.rb +29 -0
  42. data/test/colorpicker2_rails_test/config/environments/production.rb +80 -0
  43. data/test/colorpicker2_rails_test/config/environments/test.rb +36 -0
  44. data/test/colorpicker2_rails_test/config/initializers/backtrace_silencers.rb +7 -0
  45. data/test/colorpicker2_rails_test/config/initializers/filter_parameter_logging.rb +4 -0
  46. data/test/colorpicker2_rails_test/config/initializers/inflections.rb +16 -0
  47. data/test/colorpicker2_rails_test/config/initializers/mime_types.rb +5 -0
  48. data/test/colorpicker2_rails_test/config/initializers/secret_token.rb +12 -0
  49. data/test/colorpicker2_rails_test/config/initializers/session_store.rb +3 -0
  50. data/test/colorpicker2_rails_test/config/initializers/wrap_parameters.rb +14 -0
  51. data/test/colorpicker2_rails_test/config/locales/en.yml +23 -0
  52. data/test/colorpicker2_rails_test/config/routes.rb +60 -0
  53. data/test/colorpicker2_rails_test/db/migrate/20141004181002_create_pages.rb +11 -0
  54. data/test/colorpicker2_rails_test/db/schema.rb +24 -0
  55. data/test/colorpicker2_rails_test/db/seeds.rb +7 -0
  56. data/test/colorpicker2_rails_test/lib/assets/.keep +0 -0
  57. data/test/colorpicker2_rails_test/lib/tasks/.keep +0 -0
  58. data/test/colorpicker2_rails_test/log/.keep +0 -0
  59. data/test/colorpicker2_rails_test/public/404.html +58 -0
  60. data/test/colorpicker2_rails_test/public/422.html +58 -0
  61. data/test/colorpicker2_rails_test/public/500.html +57 -0
  62. data/test/colorpicker2_rails_test/public/favicon.ico +0 -0
  63. data/test/colorpicker2_rails_test/public/robots.txt +5 -0
  64. data/test/colorpicker2_rails_test/test/controllers/.keep +0 -0
  65. data/test/colorpicker2_rails_test/test/controllers/page_controller_test.rb +7 -0
  66. data/test/colorpicker2_rails_test/test/fixtures/.keep +0 -0
  67. data/test/colorpicker2_rails_test/test/fixtures/pages.yml +11 -0
  68. data/test/colorpicker2_rails_test/test/helpers/.keep +0 -0
  69. data/test/colorpicker2_rails_test/test/helpers/page_helper_test.rb +4 -0
  70. data/test/colorpicker2_rails_test/test/integration/.keep +0 -0
  71. data/test/colorpicker2_rails_test/test/mailers/.keep +0 -0
  72. data/test/colorpicker2_rails_test/test/models/.keep +0 -0
  73. data/test/colorpicker2_rails_test/test/models/page_test.rb +7 -0
  74. data/test/colorpicker2_rails_test/test/test_helper.rb +15 -0
  75. data/test/colorpicker2_rails_test/vendor/assets/javascripts/.keep +0 -0
  76. data/test/colorpicker2_rails_test/vendor/assets/stylesheets/.keep +0 -0
  77. data/vendor/assets/images/alpha-horizontal.png +0 -0
  78. data/vendor/assets/images/alpha.png +0 -0
  79. data/vendor/assets/images/hue-horizontal.png +0 -0
  80. data/vendor/assets/images/hue.png +0 -0
  81. data/vendor/assets/images/saturation.png +0 -0
  82. data/vendor/assets/javascripts/bootstrap-colorpicker.js +953 -0
  83. data/vendor/assets/stylesheets/bootstrap-colorpicker.css +217 -0
  84. metadata +235 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 54096cbea3f595f974c6335c371e265e3ae1742d
4
+ data.tar.gz: 60d72cbdad737ecb515ec5879f5e1246c6a9aec5
5
+ SHA512:
6
+ metadata.gz: 333c6f54acbcf350d2f0d0290652fa16fce77a8412492175259f5681c868133556fe7824fe3292eeb1f6f826784e38e61e9a3365a65d3ceafa560e55e9a7ec7b
7
+ data.tar.gz: a09fb82c4f06dc888f8187bc534e807c2631d14572de01a43f7dc78b2c89d22c09dfc892f9af0924c5c64b689b17e6d5069cdec53c7af0e2dfacb5ce292f9b1c
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in bootstrap-colorpicker2-rails.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Scott LaBounty
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,51 @@
1
+ # Bootstrap::Colorpicker2::Rails
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'bootstrap-colorpicker2-rails'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install bootstrap-colorpicker2-rails
18
+
19
+ ## Usage
20
+
21
+ See ...
22
+
23
+ http://mjolnic.github.io/bootstrap-colorpicker/
24
+
25
+ Stylesheets (? Why the 2nd??)
26
+ Add necessary stylesheet file to app/assets/stylesheets/application.css
27
+
28
+ *= require bootstrap-colorpicker
29
+
30
+ Add necessary stylesheet file to app/assets/stylesheets/custom.css
31
+
32
+ @import "bootstrap-colorpicker";
33
+
34
+ Javascripts
35
+ Add necessary javascript(s) files to app/assets/javascripts/application.js
36
+
37
+ //= require bootstrap-colorpicker
38
+
39
+
40
+ Using bootstrap-colorpicker-rails
41
+ Just call colorpicker() with any selector.
42
+
43
+ $('.colorpicker').colorpicker()
44
+
45
+ ## Contributing
46
+
47
+ 1. Fork it
48
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
49
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
50
+ 4. Push to the branch (`git push origin my-new-feature`)
51
+ 5. Create new Pull Request
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'bootstrap/colorpicker2/rails/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "bootstrap-colorpicker2-rails"
8
+ spec.version = Bootstrap::Colorpicker2::Rails::VERSION
9
+ spec.authors = ["Scott LaBounty"]
10
+ spec.email = ["slabounty@gmail.com"]
11
+ spec.description = %q{A colorpicker for Bootstrap bundled for Rails}
12
+ spec.summary = %q{A colorpicker for Bootstrap bundled for Rails}
13
+ spec.homepage = "https://github.com/slabounty/bootstrap-colorpicker2-rails"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_dependency "railties", "~> 4.0"
22
+
23
+ spec.add_development_dependency "bundler", "~> 1.3"
24
+ spec.add_development_dependency "rake"
25
+ end
@@ -0,0 +1 @@
1
+ require 'bootstrap/colorpicker2/rails/engine'
@@ -0,0 +1,10 @@
1
+ require "bootstrap/colorpicker2/rails/version"
2
+
3
+ module Bootstrap
4
+ module Colorpicker2
5
+ module Rails
6
+ class Engine < ::Rails::Engine
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,7 @@
1
+ module Bootstrap
2
+ module Colorpicker2
3
+ module Rails
4
+ VERSION = "0.0.1"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,16 @@
1
+ # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2
+ #
3
+ # If you find yourself ignoring temporary files generated by your text editor
4
+ # or operating system, you probably want to add a global ignore instead:
5
+ # git config --global core.excludesfile '~/.gitignore_global'
6
+
7
+ # Ignore bundler config.
8
+ /.bundle
9
+
10
+ # Ignore the default SQLite database.
11
+ /db/*.sqlite3
12
+ /db/*.sqlite3-journal
13
+
14
+ # Ignore all logfiles and tempfiles.
15
+ /log/*.log
16
+ /tmp
@@ -0,0 +1,49 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
4
+ gem 'rails', '4.0.8'
5
+ gem 'bootstrap-sass', '2.3.2.0'
6
+ gem 'sprockets', '2.11.0'
7
+
8
+ # Use sqlite3 as the database for Active Record
9
+ gem 'sqlite3'
10
+
11
+ # Use SCSS for stylesheets
12
+ gem 'sass-rails', '~> 4.0.2'
13
+
14
+ # Use Uglifier as compressor for JavaScript assets
15
+ gem 'uglifier', '>= 1.3.0'
16
+
17
+ # Use CoffeeScript for .js.coffee assets and views
18
+ gem 'coffee-rails', '~> 4.0.0'
19
+
20
+ # See https://github.com/sstephenson/execjs#readme for more supported runtimes
21
+ # gem 'therubyracer', platforms: :ruby
22
+
23
+ # Use jquery as the JavaScript library
24
+ gem 'jquery-rails'
25
+
26
+ # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
27
+ gem 'turbolinks'
28
+
29
+ # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
30
+ gem 'jbuilder', '~> 1.2'
31
+
32
+ group :doc do
33
+ # bundle exec rake doc:rails generates the API under doc/api.
34
+ gem 'sdoc', require: false
35
+ end
36
+
37
+ gem 'bootstrap-colorpicker2-rails', path: '../../'
38
+
39
+ # Use ActiveModel has_secure_password
40
+ # gem 'bcrypt', '~> 3.1.7'
41
+
42
+ # Use unicorn as the app server
43
+ # gem 'unicorn'
44
+
45
+ # Use Capistrano for deployment
46
+ # gem 'capistrano', group: :development
47
+
48
+ # Use debugger
49
+ # gem 'debugger', group: [:development, :test]
@@ -0,0 +1,28 @@
1
+ == README
2
+
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
+
6
+ Things you may want to cover:
7
+
8
+ * Ruby version
9
+
10
+ * System dependencies
11
+
12
+ * Configuration
13
+
14
+ * Database creation
15
+
16
+ * Database initialization
17
+
18
+ * How to run the test suite
19
+
20
+ * Services (job queues, cache servers, search engines, etc.)
21
+
22
+ * Deployment instructions
23
+
24
+ * ...
25
+
26
+
27
+ Please feel free to use a different markup language if you do not plan to run
28
+ <tt>rake doc:app</tt>.
@@ -0,0 +1,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require File.expand_path('../config/application', __FILE__)
5
+
6
+ Colorpicker2Test::Application.load_tasks
@@ -0,0 +1,17 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file.
9
+ //
10
+ // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require jquery
14
+ //= require jquery_ujs
15
+ //= require turbolinks
16
+ //= require_tree .
17
+ //= require bootstrap-colorpicker
@@ -0,0 +1,3 @@
1
+ # Place all the behaviors and hooks related to the matching controller here.
2
+ # All this logic will automatically be available in application.js.
3
+ # You can use CoffeeScript in this file: http://coffeescript.org/
@@ -0,0 +1,13 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
10
+ *
11
+ *= require_self
12
+ *= require_tree .
13
+ */
@@ -0,0 +1,2 @@
1
+ @import "bootstrap";
2
+ @import "bootstrap-colorpicker";
@@ -0,0 +1,3 @@
1
+ // Place all the styles related to the Page controller here.
2
+ // They will automatically be included in application.css.
3
+ // You can use Sass (SCSS) here: http://sass-lang.com/
@@ -0,0 +1,5 @@
1
+ class ApplicationController < ActionController::Base
2
+ # Prevent CSRF attacks by raising an exception.
3
+ # For APIs, you may want to use :null_session instead.
4
+ protect_from_forgery with: :exception
5
+ end
@@ -0,0 +1,26 @@
1
+ class PagesController < ApplicationController
2
+ def new
3
+ @page = Page.new
4
+ end
5
+
6
+ def create
7
+ @page = Page.new(page_params)
8
+ if @page.save
9
+ flash[:success] = "Page Saved"
10
+ redirect_to @page
11
+ else
12
+ render 'new'
13
+ end
14
+
15
+ end
16
+
17
+ def show
18
+ @page = Page.find(params[:id])
19
+ end
20
+
21
+ private
22
+
23
+ def page_params
24
+ params.require(:page).permit(:color_1, :color_2, :color_3)
25
+ end
26
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ module PageHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ class Page < ActiveRecord::Base
2
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Colorpicker2Test</title>
5
+ <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
6
+ <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,19 @@
1
+ <div class="row">
2
+ <div class="span6 offset3">
3
+ <h1>Color Test</h1>
4
+ <%= form_for(@page) do |f| %>
5
+
6
+ <div class="row" style="margin-bottom: 150px">
7
+ <%= f.text_field :color_1, class: "demo1", value: "#00cc00" %>
8
+ </div>
9
+
10
+ <%= f.submit "Add Color", class: "btn btn-large btn-primary" %>
11
+ <% end %>
12
+ </div>
13
+ </div>
14
+
15
+ <script>
16
+ $(function(){
17
+ $('.demo1').colorpicker();
18
+ });
19
+ </script>
@@ -0,0 +1,3 @@
1
+ <%= @page.color_1 %>
2
+ <%= @page.color_2 %>
3
+ <%= @page.color_3 %>
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+ load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
3
+ require_relative '../config/boot'
4
+ require 'rails/commands'
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative '../config/boot'
3
+ require 'rake'
4
+ Rake.application.run
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Rails.application
@@ -0,0 +1,25 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+
5
+ # Require the gems listed in Gemfile, including any gems
6
+ # you've limited to :test, :development, or :production.
7
+ Bundler.require(*Rails.groups)
8
+
9
+ module Colorpicker2Test
10
+ class Application < Rails::Application
11
+ # Settings in config/environments/* take precedence over those specified here.
12
+ # Application configuration should go into files in config/initializers
13
+ # -- all .rb files in that directory are automatically loaded.
14
+
15
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
16
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
17
+ # config.time_zone = 'Central Time (US & Canada)'
18
+
19
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
20
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
21
+ # config.i18n.default_locale = :de
22
+
23
+ config.assets.precompile += %w(*.png *.jpg *.jpeg *.gif)
24
+ end
25
+ end