rails_admin_robots_txt 0.1.0.2 → 0.1.0.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5aae30691acf1e0f3552002627dac608ff5b5123
4
- data.tar.gz: e461be45bb670fa1e33fe6ce6fe06b700054b25d
3
+ metadata.gz: fca7ce124f97c3644107b63a9e2592089f3b159a
4
+ data.tar.gz: d4139bb219116583e2e077b249976319f2678b79
5
5
  SHA512:
6
- metadata.gz: df89ffdda0a0adf5918b9f1720a6ba8fae2a2ddc008a19142615e9ebafe0813f9ec27cceddbd96d10865e0e77c70ee2b7ec0e9efe8838f21d105c61f63c0ed6f
7
- data.tar.gz: 8314640db871577d4b981f2e9a1ea5023c34d2cc20fc4471c70507fcd0a62fd42f5de2c362ef8552fc78d78f880ef5cdec45532a9646e3ff6e9570d03ca28a55
6
+ metadata.gz: 127d3d2b42f8cc6a46dc43c8f831d855455e24a59951297ab508d3699fec8bbea18b8a139e5833a099075ecb72ca4d43b66faaf96c3cd75313f73c915b0ca1a3
7
+ data.tar.gz: 009373eff3abf4c9f18327731d6386bafbe7d24bd0e07b484febd338dd9884d2aa8faa458093ff0e6bd84def6c9e06cdd24c68ae1328f21745d6d8b851c160d6
@@ -3,7 +3,6 @@
3
3
  #rails_admin_robots_txt
4
4
  .controls
5
5
  = form_for "robots_txt", url: robots_txt_path(model_name: @abstract_model), method: :post do |f|
6
- p= f.submit "Сохранить robots.txt"
7
6
  p= f.text_area :content, @textarea_opts
8
7
  p= f.submit "Сохранить robots.txt"
9
8
 
@@ -32,6 +32,16 @@ module RailsAdmin
32
32
  if request.get?
33
33
  text = File.read(Rails.root.join("public", "robots.txt"))
34
34
 
35
+ # https://github.com/javierjulio/textarea-autosize/blob/master/src/jquery.textarea_autosize.js
36
+ onkeyup = [
37
+ "diff = ",
38
+ "parseInt($(this).css('paddingBottom')) + ",
39
+ "parseInt($(this).css('paddingTop')) + ",
40
+ "parseInt($(this).css('borderTopWidth')) + ",
41
+ "parseInt($(this).css('borderBottomWidth')) || 0; ",
42
+ "$(this).height(0).height(this.scrollHeight - diff);"
43
+ ]
44
+
35
45
  # {value: text, cols: 80..150, cols: 5..20}
36
46
  @textarea_opts = {value: text}
37
47
  @textarea_opts[:cols] = text.lines.map(&:size).max || 80
@@ -40,6 +50,8 @@ module RailsAdmin
40
50
  @textarea_opts[:rows] = text.lines.count + 1
41
51
  @textarea_opts[:rows] = 5 if @textarea_opts[:rows] < 5
42
52
  @textarea_opts[:rows] = 20 if @textarea_opts[:rows] > 20
53
+ @textarea_opts[:onkeyup] = onkeyup.join
54
+ @textarea_opts[:oninput] = onkeyup.join
43
55
 
44
56
  render action: @action.template_name
45
57
 
@@ -1,3 +1,3 @@
1
1
  module RailsAdminRobotsTxt
2
- VERSION = "0.1.0.2"
2
+ VERSION = "0.1.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_admin_robots_txt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.2
4
+ version: 0.1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Kiseliev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-18 00:00:00.000000000 Z
11
+ date: 2017-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler