textile_editor_helper 0.0.12 → 0.0.13

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -64,7 +64,11 @@ Currently the _simple_ tags are: _bold_, _underline_, _italic_, _strikethrough_.
64
64
 
65
65
  To create a text area that will only use the 'simple' tags create your text area with the following code:
66
66
 
67
- <%= textile_editor 'object', 'field', :simple -%>
67
+ <%= textile_editor 'object', 'field', :simple=>true -%>
68
+
69
+ or
70
+
71
+ <%= f.textile_editor :body, :simple=>true %>
68
72
 
69
73
 
70
74
  To Modify Textile Editor Helper
data/Rakefile CHANGED
@@ -3,5 +3,6 @@ require "bundler/gem_tasks"
3
3
  task(:default).clear
4
4
  task :default => [:cucumber]
5
5
 
6
+
6
7
  require 'cucumber/rake/task'
7
8
  Cucumber::Rake::Task.new
@@ -1,3 +1,3 @@
1
1
  module TextileEditorHelper
2
- VERSION = "0.0.12"
2
+ VERSION = "0.0.13"
3
3
  end
@@ -44,17 +44,18 @@ module ActionView
44
44
  def textile_editor(object_name, method, options = {})
45
45
  editor_id = options[:id] || '%s_%s' % [object_name, method]
46
46
  mode = options.delete(:simple) ? 'simple' : 'extended'
47
+ preview = options.delete(:preview) ? true : false
47
48
  (@textile_editor_ids ||= []) << [editor_id.to_s, mode.to_s]
48
49
 
49
50
  output = []
50
51
  output << InstanceTag.new(object_name, method, self, options.delete(:object)).to_text_area_tag(options)
51
- output << %q{<div id="%s_destination" class="textile-preview"></div>} % [editor_id] if options[:preview]
52
+ output << %q{<div id="%s_destination" class="textile-preview"></div>} % [editor_id] if preview
52
53
  output.join("\n").html_safe
53
54
 
54
55
  end
55
56
 
56
57
  def textile_editor_options(options={})
57
- (@textile_editor_options ||= { :preview=>false }).merge! options
58
+ (@textile_editor_options ||= { }).merge! options
58
59
  end
59
60
 
60
61
  def textile_editor_support
@@ -123,6 +124,7 @@ module ActionView
123
124
  hash = dom_ids.last.dup
124
125
  options.merge! hash
125
126
  dom_ids.last.delete :framework
127
+ dom_ids.last.delete :preview
126
128
  end
127
129
 
128
130
  editor_ids = (@textile_editor_ids || []) + textile_extract_dom_ids(*dom_ids)
@@ -4,7 +4,7 @@ require File.expand_path('../lib/textile_editor_helper/version', __FILE__)
4
4
  Gem::Specification.new do |gem|
5
5
  gem.authors = ["Katherine"]
6
6
  gem.email = ["info@bridgeutopiaweb.com"]
7
- gem.description = %q{Textile Editor Helper is a gem for Ruby on Rails 3.1 > to add a Textile toolbar above textareas.}
7
+ gem.description = %q{Textile Editor Helper is a gem for Ruby on Rails 3.2 > to add a Textile toolbar above textareas.}
8
8
  gem.summary = %q{Textile Editor Helper}
9
9
  gem.homepage = "https://github.com/bridgeutopia/textile_editor_helper"
10
10
 
@@ -7,7 +7,6 @@ module TextilePreviewHelper
7
7
  coder = HTMLEntities.new
8
8
  m = coder.decode(m)
9
9
  m = RedCloth.new(m).to_html
10
- m = view_context.raw m.gsub('<p>&nbsp;</p>', "")
11
10
  m
12
11
  end
13
12
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: textile_editor_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-15 00:00:00.000000000Z
12
+ date: 2012-02-16 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &70138035855020 !ruby/object:Gem::Requirement
16
+ requirement: &70294280160640 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 3.2.0
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70138035855020
24
+ version_requirements: *70294280160640
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: coffee-rails
27
- requirement: &70138035854400 !ruby/object:Gem::Requirement
27
+ requirement: &70294280160100 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 3.2.1
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70138035854400
35
+ version_requirements: *70294280160100
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: thor
38
- requirement: &70138035853960 !ruby/object:Gem::Requirement
38
+ requirement: &70294280159700 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70138035853960
46
+ version_requirements: *70294280159700
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: test-unit
49
- requirement: &70138035853380 !ruby/object:Gem::Requirement
49
+ requirement: &70294280159200 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70138035853380
57
+ version_requirements: *70294280159200
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: RedCloth
60
- requirement: &70138035844060 !ruby/object:Gem::Requirement
60
+ requirement: &70294280158660 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 4.2.9
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70138035844060
68
+ version_requirements: *70294280158660
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: htmlentities
71
- requirement: &70138035843520 !ruby/object:Gem::Requirement
71
+ requirement: &70294280158140 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: 4.3.1
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *70138035843520
79
+ version_requirements: *70294280158140
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: cucumber
82
- requirement: &70138035842880 !ruby/object:Gem::Requirement
82
+ requirement: &70294280157640 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: 1.1.4
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *70138035842880
90
+ version_requirements: *70294280157640
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: rspec
93
- requirement: &70138035840100 !ruby/object:Gem::Requirement
93
+ requirement: &70294280157140 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
@@ -98,8 +98,8 @@ dependencies:
98
98
  version: 2.0.0
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *70138035840100
102
- description: Textile Editor Helper is a gem for Ruby on Rails 3.1 > to add a Textile
101
+ version_requirements: *70294280157140
102
+ description: Textile Editor Helper is a gem for Ruby on Rails 3.2 > to add a Textile
103
103
  toolbar above textareas.
104
104
  email:
105
105
  - info@bridgeutopiaweb.com