ajax_canvas_field 0.0.4 → 0.0.5

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: 016613ee17ea5c099cffd05dd8f09c9bd3d1916e
4
- data.tar.gz: 2f36c4082f8ec81255bda07cc01fe1f3914ee572
3
+ metadata.gz: c9255a0fcb8af907db44abb00ed37621d5d2b18b
4
+ data.tar.gz: '0081b9fb765eeba33e525a7b3334f19323f2288a'
5
5
  SHA512:
6
- metadata.gz: 8f09d2cf6aa8235e729281a96fd32265e4c6b3e8d9dfe63f79b523609097db9abd511bf4bf17f0b82f74fa4e68d4eeb33d0dc5ef7e13ffff0ff609ccd0fa035d
7
- data.tar.gz: 38b0241032d585e38fde3b200431924435a9c7d4643a4f68c552c3d71c7d984744e7508c3cc2c7548cdfe8cd249b9f918c52ad195584fc42659e427e65eebcf6
6
+ metadata.gz: c0dffa02118ff8665d65f5be6594e77abf22c1f375e37dc6f382614cbdb194a7cf58eeada06a53dc385de44e5328ff5a39bce92b92e2354c060c32a8d63d5813
7
+ data.tar.gz: 15273d04a079fa0196988b04accc3e11c4ca98eb805e74e5108bbdc84146ff35285bf711041e210563e0646eb523aa6815942ae4597c581ac3820ab71594ca07
@@ -2,9 +2,10 @@
2
2
 
3
3
  module CanvasFieldHelper
4
4
  def canvas_field(options = {})
5
- url = '/'
5
+ url = options[:server].to_s + '/'
6
6
  url += options[:namespace].to_s + '/' if options[:namespace]
7
7
  url += options[:controller] || 'canvas_fields'
8
+ url = url.gsub('//', '/')
8
9
 
9
10
  background_url = options[:background_url].blank? ? '' : "url(#{options[:background_url]})"
10
11
  background = "background: #fff #{background_url} no-repeat center top"
@@ -51,7 +52,7 @@ module CanvasFieldHelper
51
52
  def collect_data(url, options)
52
53
  { url: url,
53
54
  strong_param: options[:param] || options[:controller]&.singularize || 'canvas_field',
54
- token: options[:token],
55
+ token: options[:token] || session[:token],
55
56
  width: options[:width] || AjaxCanvasField.config[:default_width],
56
57
  height: options[:height] || AjaxCanvasField.config[:default_height],
57
58
  left_color: options[:left_color] || '#ff0000',
@@ -1,5 +1,5 @@
1
1
  module AjaxCanvasField #:nodoc:
2
2
  module Rails #:nodoc:
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  end
@@ -8,6 +8,7 @@ class AjaxCanvasFieldGenerator < Rails::Generators::Base
8
8
  copy_file "initializer.rb", "config/initializers/ajax_canvas_field.rb"
9
9
 
10
10
  inject_into_file 'app/assets/javascripts/application.js', "//= require ajax_canvas_field\n", before: "//= require_tree ." rescue nil
11
+ inject_into_file 'app/assets/javascripts/application.coffee', "//= require ajax_canvas_field\n", before: "//= require_tree ." rescue nil
11
12
  inject_into_file 'app/assets/stylesheets/application.scss', " *= require ajax_canvas_field\n", before: " *= require_tree ." rescue nil
12
13
  inject_into_file 'app/assets/stylesheets/application.scss.erb', " *= require ajax_canvas_field\n", before: " *= require_tree ." rescue nil
13
14
  inject_into_file 'app/assets/stylesheets/application.css.scss', " *= require ajax_canvas_field\n", before: " *= require_tree ." rescue nil
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  AjaxCanvasField.configure(default_height: 400,
4
- default_width: 400,
4
+ default_width: 340,
5
5
  default_left_color: '#ff0000',
6
6
  default_middle_color: '#00ff00',
7
7
  default_right_color: '#0000ff')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ajax_canvas_field
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - datyv
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-26 00:00:00.000000000 Z
11
+ date: 2017-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler