activeadmin_pagedown 0.0.1 → 0.0.2

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.
data/.gitignore CHANGED
@@ -15,3 +15,5 @@ capybara-*.html
15
15
  rerun.txt
16
16
  pickle-email-*.html
17
17
  *.iml
18
+ *.gem
19
+ /pkg/
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- activeadmin_pagedown (0.0.1)
4
+ activeadmin_pagedown (0.0.2)
5
5
  activeadmin (>= 0.5.0)
6
6
 
7
7
  GEM
@@ -1,5 +1,16 @@
1
1
  $(document).ready(function() {
2
- var converter1 = Markdown.getSanitizingConverter();
3
- var editor1 = new Markdown.Editor(converter1);
4
- editor1.run();
2
+ $wmd_input = $('.wmd-input');
3
+ if ( $wmd_input.length > 0 ) {
4
+
5
+ $wmd_input.each(function( index ) {
6
+ $this = $(this);
7
+ $this.attr('id', 'wmd-input-' + index);
8
+ $this.closest('.pagedown_text').find('.wmd-preview').attr('id', 'wmd-preview-' + index);
9
+ $this.closest('.wmd-panel').find('.wmd-button-bar').attr('id', 'wmd-button-bar-' + index);
10
+ converter = Markdown.getSanitizingConverter();
11
+ options = {};
12
+ editor = new Markdown.Editor(converter, "-" + index, options );
13
+ editor.run();
14
+ });
15
+ }
5
16
  });
@@ -2,7 +2,7 @@ class PagedownTextInput < Formtastic::Inputs::StringInput
2
2
 
3
3
 
4
4
  def input_html_options
5
- super.merge(:class => "wmd-input", :id => 'wmd-input')
5
+ super.merge(:class => "wmd-input")
6
6
  end
7
7
 
8
8
  def to_html
@@ -11,13 +11,13 @@ class PagedownTextInput < Formtastic::Inputs::StringInput
11
11
  label_html <<
12
12
 
13
13
  template.content_tag(:div, :class => 'wmd-panel' ) do
14
- template.content_tag(:div, "", :id => 'wmd-button-bar') <<
14
+ template.content_tag(:div, "", :class => 'wmd-button-bar') <<
15
15
  builder.text_area(method, input_html_options)
16
16
  end <<
17
17
 
18
18
  template.content_tag(:div, "", :style=> 'margin-top:20px' ) do
19
19
  template.content_tag(:label, "Preview" ) <<
20
- template.content_tag(:div, "", :id => "wmd-preview", :class => "wmd-panel wmd-preview" )
20
+ template.content_tag(:div, "", :class => "wmd-panel wmd-preview" )
21
21
  end
22
22
  end.html_safe
23
23
  end
@@ -1,3 +1,3 @@
1
1
  module ActiveAdminPagedown
2
- VERSION = "0.0.1"
3
- end
2
+ VERSION = "0.0.2"
3
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeadmin_pagedown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-12 00:00:00.000000000 Z
12
+ date: 2013-01-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activeadmin
@@ -65,12 +65,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
65
65
  - - ! '>='
66
66
  - !ruby/object:Gem::Version
67
67
  version: '0'
68
+ segments:
69
+ - 0
70
+ hash: 2812949798030819770
68
71
  required_rubygems_version: !ruby/object:Gem::Requirement
69
72
  none: false
70
73
  requirements:
71
74
  - - ! '>='
72
75
  - !ruby/object:Gem::Version
73
76
  version: '0'
77
+ segments:
78
+ - 0
79
+ hash: 2812949798030819770
74
80
  requirements: []
75
81
  rubyforge_project:
76
82
  rubygems_version: 1.8.24