stay 0.1.3.3 → 0.1.3.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -73,6 +73,15 @@ This will use TinyMCE editor with "simple" theme, you can also change this theme
73
73
  ```ruby
74
74
  stay [@user, @article], :body, type: [:tiny_mce, "advanced"]
75
75
  ```
76
+ Now you can pass width and height of tinyMCE using CSS string format
77
+
78
+ Example
79
+
80
+ ```ruby
81
+ stay [@user, @article], :body, type: [:tiny_mce, "advanced", "100%", "200px"]
82
+ ```
83
+
84
+ Remember to put width and height respectively
76
85
 
77
86
  When called, by default **Stay** triggered by clicking the displayed text on HTML page.
78
87
  **Stay** accept external trigger and submit button:
data/Rakefile CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- Echoe.new('stay', '0.1.3.3') do |p|
5
+ Echoe.new('stay', '0.1.3.4') do |p|
6
6
  p.description = "Form ajax helper with tinymce support"
7
7
  p.summary = "Helper for building ajax form, inspired by best_in_place, with some modifications, support tinymce as editor"
8
8
  p.url = "http://github.com/tejanium/stay"
@@ -44,7 +44,7 @@ Stay.prototype = {
44
44
  setup : function(ed) {
45
45
  ed.onInit.add(function(ed, evt) {
46
46
  var dom = ed.dom;
47
- var doc = ed.getDoc();
47
+ var doc = tinymce.isGecko ? ed.getDoc() : ed.getWin();
48
48
  if(typeof self.submitter_id === "undefined"){
49
49
  tinymce.dom.Event.add(doc, 'blur', function(e) {
50
50
  self.stayFormForm.submit();
data/lib/stay/helper.rb CHANGED
@@ -3,7 +3,15 @@ module Stay
3
3
  def generate_form(object, field, type = :text_field)
4
4
  form_for(object, remote: true, format: :json) do |f|
5
5
  if type == :tiny_mce || type.is_a?(Array)
6
- f.send(:text_area, field, class: "stay-input stay-tiny-mce")
6
+ if type == :tiny_mce
7
+ w = "100%"
8
+ h = "200px"
9
+ else
10
+ w = type[2] || "100%"
11
+ h = type[3] || "200px"
12
+ end
13
+ object_id = (object.is_a?(Array) ? object.last : object).id
14
+ f.send(:text_area, field, class: "stay-input stay-tiny-mce", id: "stay-mce-#{ object_id }", style: "width:#{w}; height:#{h};")
7
15
  else
8
16
  f.send(type, field, class: "stay-input")
9
17
  end
data/stay.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "stay"
5
- s.version = "0.1.3.3"
5
+ s.version = "0.1.3.4"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Teja Sophista"]
9
- s.date = "2012-02-07"
9
+ s.date = "2012-02-08"
10
10
  s.description = "Form ajax helper with tinymce support"
11
11
  s.email = "tejanium@yahoo.com"
12
12
  s.extra_rdoc_files = ["README.md", "README.rdoc", "lib/assets/javascripts/stay.js", "lib/stay.rb", "lib/stay/controller_extensions.rb", "lib/stay/engine.rb", "lib/stay/helper.rb", "lib/stay/string_extensions.rb"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stay
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3.3
4
+ version: 0.1.3.4
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-07 00:00:00.000000000Z
12
+ date: 2012-02-08 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jquery-rails
16
- requirement: &24641760 !ruby/object:Gem::Requirement
16
+ requirement: &20410080 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *24641760
24
+ version_requirements: *20410080
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: tinymce-rails
27
- requirement: &24641300 !ruby/object:Gem::Requirement
27
+ requirement: &20409620 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *24641300
35
+ version_requirements: *20409620
36
36
  description: Form ajax helper with tinymce support
37
37
  email: tejanium@yahoo.com
38
38
  executables: []