use_tinymce 0.0.17 → 0.1.1
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/README.markdown +7 -7
- data/Rakefile +2 -2
- data/lib/tasks/use_tinymce.rake +19 -20
- data/lib/use_tinymce.rb +1 -0
- data/lib/use_tinymce/railengine.rb +1 -1
- data/lib/use_tinymce/use_tinymce.rb +1 -1
- data/lib/use_tinymce/version.rb +5 -1
- metadata +2 -2
data/README.markdown
CHANGED
@@ -6,14 +6,14 @@ UseTinyMCE
|
|
6
6
|
==========
|
7
7
|
|
8
8
|
**UseTinyMCE** is yet another (as if we needed another) hack for including
|
9
|
-
TinyMCE in a Rails 3.0, 3.1, 3.2 or 4.
|
9
|
+
TinyMCE in a Rails 3.0, 3.1, 3.2, 4.0, 4.1, or 4.2 app.
|
10
10
|
|
11
11
|
**NOTE:** Rails 3.1.0 broke version 0.0.8. The current version has been tested
|
12
12
|
on Rails 4.0.0. It *should* work on 3.0, 3.1 and 3.2 because "nothing there has been changed". Let me know if this is not true.
|
13
13
|
|
14
14
|
This gem differs from the others that I looked at on rubygems in that:
|
15
15
|
|
16
|
-
1. It works with Rails [3.0](#rails_30_integration), [3.1 & 3.2](#rails_31_integration) and [4.0](#rails_40_integration) details below
|
16
|
+
1. It works with Rails [3.0](#rails_30_integration), [3.1 & 3.2](#rails_31_integration) and [4.0, 4.1, & 4.2](#rails_40_integration) details below
|
17
17
|
2. It's minimal. It does not provide any juicy Rails style configuration for
|
18
18
|
TinyMCE. You just use the config stuff which comes with TinyMCE - in javascript.
|
19
19
|
3. I've moved on to Ruby 2.0, so I'm now depending on others to find and patch bugs in 1.9.x
|
@@ -29,7 +29,7 @@ supports both *raw* TinyMCE (which works well with Prototype) and the *jquery* v
|
|
29
29
|
which works with 'jquery'. It also supports both *simple* and *advanced* editor
|
30
30
|
installations for the *raw* type.
|
31
31
|
|
32
|
-
**Rails 3.1, 3.2
|
32
|
+
**Rails 3.1, 3.2, 4.0, 4.1, 4.2 Note:** TinyMCE doesn't play well with the asset pipeline, so it is installed
|
33
33
|
in public. This has to do with the way TinyMCE is architected: it is plugin based
|
34
34
|
and scatters javascript, css, and html all through it's plugin directory. It manages it's
|
35
35
|
own loading.
|
@@ -87,7 +87,7 @@ If you don't need much and aren't familiar with *TinyMCE*, then `rake use_tinymc
|
|
87
87
|
should be fine. The *advanced* version configures *TinyMCE* with many more features. Go to
|
88
88
|
the ["TinyMCE website for details"](http://tinymce.moxiecode.com/)
|
89
89
|
|
90
|
-
Rails 3.1, 3.2
|
90
|
+
Rails 3.1, 3.2, 4.0, 4.1, 4.2
|
91
91
|
|
92
92
|
* `rake use_tinymce:install` - installs the jQuery version of TinyMCE
|
93
93
|
* `rake use_tinymce:uninstall` - removes all trace of TinyMCE & the initialization file from
|
@@ -132,7 +132,7 @@ by a previous call to `use_tinymce` [or if you included `use_tinymce :all` in yo
|
|
132
132
|
## Rake Tasks:
|
133
133
|
|
134
134
|
**NOTE** `assets` here refers to the `assets` directory in the `use_tinymce`
|
135
|
-
gem - **not** the Rails 3.1, 3.2
|
135
|
+
gem - **not** the Rails 3.1, 3.2, 4.0, 4.1, 4.2 asset pipeline directory.
|
136
136
|
|
137
137
|
This initialization scripts were copied literally from the TinyMCE website
|
138
138
|
["For Dummies" page](http://tinymce.moxiecode.com/wiki.php/%22For_Dummies%22)
|
@@ -168,11 +168,11 @@ directory from your applications `public/javascripts`
|
|
168
168
|
`rake use_tinymce::install_*` to insure you get a clean installation. This will also
|
169
169
|
*clean* out any customization you have done.
|
170
170
|
|
171
|
-
### Rails 3.1, 3.2
|
171
|
+
### Rails 3.1, 3.2, 4.0, 4.1, 4.2
|
172
172
|
|
173
173
|
**NOTE** I no longer support this gem for Rails 3.1 and 3.2. I will accept patches, but will not test them.
|
174
174
|
|
175
|
-
`use_tinymce` only supports installing the jQuery version of TinyMCE on Rails 3.1, 3.2
|
175
|
+
`use_tinymce` only supports installing the jQuery version of TinyMCE on Rails 3.1, 3.2, 4.0, 4.1, 4.2.
|
176
176
|
|
177
177
|
There are two Rake tasks:
|
178
178
|
|
data/Rakefile
CHANGED
@@ -19,7 +19,7 @@ end
|
|
19
19
|
|
20
20
|
desc "create README.markdown from README.markdown.in by replacing @@FOO@@ with FOO Value"
|
21
21
|
file "README.markdown" => ["README.markdown.in"] do
|
22
|
-
system "sed -e 's/@@VERSION@@/#{VERSION}/g' <'README.markdown.in' >'README.markdown'"
|
22
|
+
system "sed -e 's/@@VERSION@@/#{UseTinymce::VERSION}/g' <'README.markdown.in' >'README.markdown'"
|
23
23
|
end
|
24
24
|
|
25
25
|
desc "build gem"
|
@@ -33,7 +33,7 @@ end
|
|
33
33
|
|
34
34
|
desc "push to rubygems"
|
35
35
|
task :gem_push => [:gem] do
|
36
|
-
unless VERSION =~ /pre/ then
|
36
|
+
unless UseTinymce::VERSION =~ /pre/ then
|
37
37
|
system "gem push #{gem_name}-#{gem_version}.gem"
|
38
38
|
else
|
39
39
|
puts "Cannot push a pre version - test it you fool!!!!"
|
data/lib/tasks/use_tinymce.rake
CHANGED
@@ -1,17 +1,16 @@
|
|
1
1
|
require 'fileutils'
|
2
|
-
|
3
2
|
# make sure we are in the right versino of Rails
|
4
3
|
unless defined?(Rails)
|
5
4
|
puts "This rake task only runs on Rails"
|
6
5
|
exit
|
7
6
|
end
|
8
|
-
unless Rails.version =~
|
7
|
+
unless Rails.version =~ UseTinymce::RAILS_3_VERSIONS || Rails.version =~ UseTinymce::RAILS_4_VERSIONS
|
9
8
|
puts "use_tinymce Error: Don't know how to install on Rails Version #{Rails.version}"
|
10
9
|
|
11
10
|
exit
|
12
11
|
end
|
13
12
|
|
14
|
-
module
|
13
|
+
module UseTinymce
|
15
14
|
module RakeSupport
|
16
15
|
# gem paths - used to source for installation
|
17
16
|
USE_TINYMCE_ROOT = File.expand_path('../../../', __FILE__)
|
@@ -78,53 +77,53 @@ end
|
|
78
77
|
namespace :use_tinymce do
|
79
78
|
desc "uninstall use_tinymce javascript code"
|
80
79
|
task :uninstall do
|
81
|
-
init_file_path = File.join(
|
80
|
+
init_file_path = File.join(UseTinymce::RakeSupport::JAVASCRIPT_ROOT, 'use_tinymce_init.js')
|
82
81
|
File.delete(init_file_path) if File.exists? init_file_path
|
83
82
|
|
84
|
-
tinymce_root_path = File.join(
|
85
|
-
|
83
|
+
tinymce_root_path = File.join(UseTinymce::RakeSupport::JAVASCRIPT_ROOT, 'tinymce')
|
84
|
+
UseTinymce::RakeSupport::rmdir_tree(tinymce_root_path) if File.exists? tinymce_root_path
|
86
85
|
end
|
87
86
|
|
88
87
|
case Rails.version
|
89
88
|
when /^3.0/
|
90
89
|
# common task - this undescribed task installs the non-jquery version of TinyMCE, but not the initialization script
|
91
90
|
task :install_tinymce_advanced => :uninstall do
|
92
|
-
raise Exception.new("Cannot install: #{
|
93
|
-
FileUtils.cp_r File.join(
|
91
|
+
raise Exception.new("Cannot install: #{UseTinymce::RakeSupport::JAVASCRIPT_ROOT} does not exist") unless UseTinymce::RakeSupport.mkdir_tree UseTinymce::RakeSupport::JAVASCRIPT_ROOT
|
92
|
+
FileUtils.cp_r File.join(UseTinymce::RakeSupport::ASSETS_ROOT, 'tinymce_no_jquery', 'tinymce'), UseTinymce::RakeSupport::JAVASCRIPT_ROOT
|
94
93
|
end
|
95
94
|
# common task - this undescribed task installs the jquery version of TinyMCE, but not the initialization script
|
96
95
|
task :install_tinymce_jquery => :uninstall do
|
97
|
-
raise Exception.new("Cannot install: #{
|
98
|
-
FileUtils.cp_r File.join(
|
96
|
+
raise Exception.new("Cannot install: #{UseTinymce::RakeSupport::JAVASCRIPT_ROOT} does not exist") unless UseTinymce::RakeSupport.mkdir_tree UseTinymce::RakeSupport::JAVASCRIPT_ROOT
|
97
|
+
FileUtils.cp_r File.join(UseTinymce::RakeSupport::ASSETS_ROOT, 'tinymce_jquery', 'tinymce'), UseTinymce::RakeSupport::JAVASCRIPT_ROOT
|
99
98
|
end
|
100
99
|
|
101
100
|
desc "Install tinymce with 'simple' initialization"
|
102
101
|
task :install_simple => :install_tinymce_advanced do
|
103
|
-
|
102
|
+
UseTinymce::RakeSupport::copy_init_script('use_tinymce_init_simple.js')
|
104
103
|
end
|
105
104
|
|
106
105
|
desc "Install tinymce with 'advanced' initialization"
|
107
106
|
task :install_advanced => :install_tinymce_advanced do
|
108
|
-
|
107
|
+
UseTinymce::RakeSupport::copy_init_script('use_tinymce_init_advanced.js')
|
109
108
|
end
|
110
109
|
|
111
110
|
desc "Install tinymce jquery plugin with 'advanced' initialization"
|
112
111
|
task :install_jquery => :install_tinymce_jquery do
|
113
|
-
|
112
|
+
UseTinymce::RakeSupport::copy_init_script('use_tinymce_init_jquery.js')
|
114
113
|
end
|
115
114
|
when /^3\.[12]/
|
116
115
|
desc "Install tinymce jquery plugin with 'advanced' initialization"
|
117
116
|
task :install => :uninstall do
|
118
|
-
raise Exception.new("Cannot install: #{
|
119
|
-
FileUtils.cp_r File.join(
|
120
|
-
|
117
|
+
raise Exception.new("Cannot install: #{UseTinymce::RakeSupport::JAVASCRIPT_ROOT} does not exist") unless UseTinymce::RakeSupport.mkdir_tree UseTinymce::RakeSupport::JAVASCRIPT_ROOT
|
118
|
+
FileUtils.cp_r File.join(UseTinymce::RakeSupport::ASSETS_ROOT, 'tinymce_jquery', 'tinymce'), UseTinymce::RakeSupport::JAVASCRIPT_ROOT
|
119
|
+
UseTinymce::RakeSupport::copy_init_script('use_tinymce_init_jquery.js')
|
121
120
|
end
|
122
|
-
when
|
121
|
+
when UseTinymce::RAILS_4_VERSIONS
|
123
122
|
desc "Install tinymce jquery plugin with 'advanced' initialization"
|
124
123
|
task :install => :uninstall do
|
125
|
-
raise Exception.new("Cannot install: #{
|
126
|
-
FileUtils.cp_r File.join(
|
127
|
-
|
124
|
+
raise Exception.new("Cannot install: #{UseTinymce::RakeSupport::JAVASCRIPT_ROOT} does not exist") unless UseTinymce::RakeSupport.mkdir_tree UseTinymce::RakeSupport::JAVASCRIPT_ROOT
|
125
|
+
FileUtils.cp_r File.join(UseTinymce::RakeSupport::ASSETS_ROOT, 'tinymce_jquery_4_0_2', 'tinymce'), UseTinymce::RakeSupport::JAVASCRIPT_ROOT
|
126
|
+
UseTinymce::RakeSupport::copy_init_script('use_tinymce_init_jquery_4_0_2.js')
|
128
127
|
end
|
129
128
|
# desc "Remove tinymce jquery plugin and re-install it - WARNING: Destroys your customizations"
|
130
129
|
# task :reinstall => :uninstall do |tsk|
|
data/lib/use_tinymce.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module UseTinymce
|
2
2
|
class Engine < Rails::Engine
|
3
|
-
if Rails.version =~
|
3
|
+
if Rails.version =~ RAILS_3_VERSIONS || Rails.version =~ RAILS_4_VERSIONS
|
4
4
|
initializer "active_support.add_use_tinymce" do
|
5
5
|
::ActiveSupport.on_load(:action_controller) do
|
6
6
|
include UseTinymce::Base
|
@@ -25,7 +25,7 @@ module UseTinymce
|
|
25
25
|
|
26
26
|
if defined? Rails
|
27
27
|
module Link
|
28
|
-
if Rails.version =~
|
28
|
+
if Rails.version =~ RAILS_3_VERSIONS || Rails.version =~ RAILS_4_VERSIONS
|
29
29
|
def use_tinymce_link
|
30
30
|
if defined?(params) && use_tinymce?(params[:action])
|
31
31
|
ret = ''
|
data/lib/use_tinymce/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: use_tinymce
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.1
|
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:
|
12
|
+
date: 2015-01-21 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: ! 'UseTinymce - Yet Another tinyMCE integrations gem for Rails 3
|
15
15
|
|