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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9255a0fcb8af907db44abb00ed37621d5d2b18b
|
4
|
+
data.tar.gz: '0081b9fb765eeba33e525a7b3334f19323f2288a'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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',
|
@@ -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
|
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
|
+
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-
|
11
|
+
date: 2017-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|