use_tinymce 0.0.4 → 0.0.5
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 +72 -8
- metadata +2 -2
data/README.markdown
CHANGED
@@ -13,9 +13,9 @@ tinyMCE. You just use the config stuff which comes with tinyMCE - in javascript.
|
|
13
13
|
What's Provided
|
14
14
|
================
|
15
15
|
|
16
|
-
Three methods:
|
16
|
+
## Three methods:
|
17
17
|
|
18
|
-
`use_tinymce
|
18
|
+
`use_tinymce(*actions)` - which is added to ApplicationController as a Class Method.
|
19
19
|
|
20
20
|
`*actions` is 0 or more method names or the distinguished symbol `:all`. You put
|
21
21
|
this someplace in your controller if you want any of your controller actions
|
@@ -27,22 +27,86 @@ value of `params[:action]`
|
|
27
27
|
|
28
28
|
If you want or need finer control, use `use_tinymce?` and write your own conditional.
|
29
29
|
|
30
|
-
`use_tinymce?
|
31
|
-
the `head` element of your page. It returns `true` if `action` was set
|
32
|
-
call to `use_tinymce` [or if you included `use_tinymce :all` in your controller]
|
30
|
+
`use_tinymce?(action)` - is a helper method you add to the cruft which creates
|
31
|
+
the `head` element of your page. It returns `true` if the symbol `action` was set
|
32
|
+
by a previous call to `use_tinymce` [or if you included `use_tinymce :all` in your controller]
|
33
|
+
`action` will usually come from `params[:action]`, so it's easier to use
|
34
|
+
`use_tinymce_link` which already does that.
|
33
35
|
|
34
|
-
Two rake tasks:
|
36
|
+
## Two rake tasks:
|
35
37
|
|
36
38
|
Both copy the contents of the `assets/tinymce` directory to your rails
|
37
|
-
`public/javascripts` directory.
|
39
|
+
`public/javascripts` directory. They both also copy a TinyMCE initialization
|
38
40
|
script to `public/javascripts/use_tinymce_init.js`
|
39
41
|
|
40
42
|
This initialization scripts are copied literally from the TinyMCE website
|
41
43
|
["For Dummies" page](http://tinymce.moxiecode.com/wiki.php/%22For_Dummies%22)
|
42
|
-
|
44
|
+
- that is: *http://tinymce.moxiecode.com/wiki.php/%22For_Dummies%22*
|
43
45
|
|
44
46
|
`rake use_tinymce:install_advanced` copies `assets/use_tinymce_ini_advanced.js` -
|
45
47
|
which provides all the full blown features.
|
46
48
|
|
47
49
|
`rake use_tinymce:install_simple` copies `assets/use_tinymce_ini_simple.js` -
|
48
50
|
copies the bare bones version.
|
51
|
+
|
52
|
+
Installation
|
53
|
+
===============
|
54
|
+
|
55
|
+
Add 'gem "manage_meta" to your Gemfile
|
56
|
+
|
57
|
+
Or
|
58
|
+
|
59
|
+
Add 'gem "manage_meta" :git => "git://github.com/mikehoward/use_tinymce.git"'
|
60
|
+
|
61
|
+
Then run 'bundle install'
|
62
|
+
|
63
|
+
Step by Step Configuration
|
64
|
+
==============
|
65
|
+
|
66
|
+
1. You will need to install *tinyMCE* in your /public/javascript directory.
|
67
|
+
Do that by running one of these rake tasks:
|
68
|
+
* `rake use_tinymce:install_simple`
|
69
|
+
* `rake use_tinymce:install_advanced`
|
70
|
+
|
71
|
+
If you don't need much and aren't familiar with *tinyMCE*, then `rake use_tinymce:install_simple`
|
72
|
+
should be fine. The *advanced* version configures *tinyMCE* with many more features. Go to
|
73
|
+
the ["tinyMCE website for details"](http://tinymce.moxiecode.com/)
|
74
|
+
2. Add `use_tinymce args` to all the controllers for views containing **textarea** fields
|
75
|
+
in which you want to run *tinyMCE*. `args` should be:
|
76
|
+
* `:all` - to enable *tinyMCE* for all actions
|
77
|
+
* `:foo, :bar` - to enable *tinyMCE* only for views rendered by `foo` and `bar` actions
|
78
|
+
3. Add `<%= use_tinymce_link %>` to the `HEAD` section of you application layout - for *at least*
|
79
|
+
all pages which should use *tinyMCE*
|
80
|
+
4. (Optional) Edit `/public/javascript/use_tinymce_init.js` to customize your *tinyMCE* feature
|
81
|
+
set.
|
82
|
+
|
83
|
+
That's it.
|
84
|
+
|
85
|
+
Relocating *tinyMCE* or Something Else
|
86
|
+
==================
|
87
|
+
|
88
|
+
This gem is pretty simple, so if you want to change the location and/or names of some files,
|
89
|
+
go ahead and hack it.
|
90
|
+
|
91
|
+
There was a time when I would have added features to allow this, but not any more. It ususally
|
92
|
+
turned out to be more trouble than it was worth.
|
93
|
+
|
94
|
+
So, if you want to do it, have a blast - but please don't send me the patches.
|
95
|
+
|
96
|
+
Upgrading *tinyMCE*
|
97
|
+
==================
|
98
|
+
|
99
|
+
`use_tinymce` ships with version 3.4.2 of *tinyMCE* - which I downloaded from the Moxiecode
|
100
|
+
website. You *should* be able to upgrade your *tinyMCE* if you want by doing the exact
|
101
|
+
same thing and then unpacking the zip file in `/public/javascript`
|
102
|
+
|
103
|
+
Alternately, you can poke around your system and find the gem and unpack the zip file
|
104
|
+
into the `use_tinymce` gem's `/assets` folder, re-run the rake tasks and . . .
|
105
|
+
**WARNING** if you do this, you'll overwrite your `use_tinymce_init.js` file and lose
|
106
|
+
all your special customizations.
|
107
|
+
|
108
|
+
Alternately (2), you can send me a note and I *might* upgrade the *tinyMCE* in the gem.
|
109
|
+
Then you'd need to do a `bundle update use_tinymce`, run the rake task, re-create your
|
110
|
+
special customizations, etc.
|
111
|
+
|
112
|
+
It's probably easier to grab the code from ["Moxiecode"](http://tinymce.moxiecode.com/download/download.php)
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: use_tinymce
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.5
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Mike Howard
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-05-
|
13
|
+
date: 2011-05-02 00:00:00 Z
|
14
14
|
dependencies: []
|
15
15
|
|
16
16
|
description: |-
|