rmce_uploadr 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/README.rdoc CHANGED
@@ -1,44 +1,64 @@
1
1
  = rmce_uploadr
2
2
 
3
- == URLs
3
+ Here's a scenario this gem is suitable for.
4
4
 
5
- === GET /rmce_uploadr/images
5
+ You have multiple rack/sinatra/rails CMS-like apps where a page editing is done with TinyMCE.
6
+ You want all of them use the same storage / database for image manipulation.
6
7
 
7
- * displays a list of all uploaded images along with their preview/snapshots
8
- * has a hidden upload form with an "upload" button
8
+ This gem uses Sinatra, ActiveRecord and Paperclip.
9
9
 
10
+ == Install
10
11
 
11
- === GET /rmce_uploadr/images/:id
12
+ For this gem to work you *have* to put your TinyMCE javascripts in public/javascripts/tiny_mce.
12
13
 
13
- Displays a single image, its available dimensions and a form-like thing to tag/untag the image.
14
+ === 1. Install the gem
14
15
 
16
+ * add <tt>config.gem "rmce_uploadr"</tt> to environment.rb and run <tt>sudo rake gems:install</tt>
17
+ * add <tt>gem "rmce_uploadr"</tt> to Gemfile if your using Bundler and run <tt>bundle install</tt>
15
18
 
16
- === PUT /rmce_uploadr/images/:id
19
+ === 2. Set RMceUploadr::App as a middleware
17
20
 
18
- Modifies an images metadata (name, tags, etc.) and the image itself.
21
+ * for a rails app add the following inside <tt>Rails::Initializer.run</tt> block:
22
+ config.middleware.use "RMceUploadr::App" do |conf|
23
+ # configuration according to ActiveRecord::Base.establish_connection
24
+ conf.dbconf = {:adapter => 'sqlite3',
25
+ :database => File.join(File.dirname(__FILE__), '..', '..', 'shared', 'db.sqlite3')}
26
+ end
27
+ * almost the same if you're a rack/sinatra app:
28
+ use ::RMceUploadr::App do |conf|
29
+ # configuration according to ActiveRecord::Base.establish_connection
30
+ conf.dbconf = {:adapter => 'sqlite3',
31
+ :database => root_path('..', 'shared', 'db.sqlite3')}
32
+ end
19
33
 
34
+ === 3. Add plugin loading to TinyMCE init function, e.g.
20
35
 
21
- === DELETE /rmce_uploadr/images/:id
36
+ <script type="text/javascript" charset="utf-8">
37
+ // Initialize TinyMCE with rmce_uploadr plugin and inlinepopups
38
+ tinyMCE.init({
39
+ plugins: "rmce_uploadr,inlinepopups",
40
+ mode : "textareas",
41
+ theme : "advanced",
42
+ dialog_type: 'modal',
43
+ theme_advanced_buttons1 : "bold,italic,underline,separator,strikethrough,bullist,numlist,undo,redo,link,unlink,image",
44
+ theme_advanced_buttons2 : "",
45
+ theme_advanced_buttons3 : "",
46
+ theme_advanced_toolbar_location : "top",
47
+ theme_advanced_toolbar_align : "left",
48
+ theme_advanced_statusbar_location : "bottom"
49
+ });
50
+ </script>
22
51
 
23
- Deletes an image from the DB as well as from the disk.
52
+ Notice <tt>plugins: "rmce_uploadr"</tt> and <tt>theme_advanced_buttons1: "image"</tt> (which you probably have already).
24
53
 
54
+ === 4. You're done
25
55
 
26
- == POST /rmce_uploadr/images
56
+ Uploaded files will live in <tt>public/uploads/g/images/:id_partition/:style_:filename</tt> so
57
+ you probably want <tt>public/uploads/g/</tt> to be shared accross all your apps.
27
58
 
28
- Upload form submition handler
29
-
30
-
31
- == GET /rmce_uploadr/tags.json
32
-
33
- Returns an array of all (unique) tags used for images tagging.
34
- e.g. [{"tag1": 3}, {"tag2": 5}, {"tag3": 7}]
35
-
36
-
37
- == GET /javascripts/<a file name>.js
38
-
39
- Returns a static javascript file from the gem's lib/rmce_uploadr/public/javascripts/ directory:
40
- * rmce_uploadr.js
41
- * tiny_mce/plugins/rmce_uploadr/editor_plugin.js
59
+ === 5. Check out rails and sinatra examples
60
+ <tt>examples/rails</tt> and <tt>examples/sinatra</tt> are setup to work with <tt>examples/shared/db.sqlite3</tt> and
61
+ <tt>examples/shared/uploads</tt> directory.
42
62
 
43
63
 
44
64
  == Note on Patches/Pull Requests
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
@@ -5,7 +5,7 @@
5
5
  <title>Sinatra Example app</title>
6
6
  <script type="text/javascript" src="/javascripts/tiny_mce/tiny_mce.js"></script>
7
7
  <script type="text/javascript" charset="utf-8">
8
- // Initialize TinyMCE with the new plugin and listbox
8
+ // Initialize TinyMCE with rmce_uploadr plugin and inlinepopups
9
9
  tinyMCE.init({
10
10
  plugins: "rmce_uploadr,inlinepopups",
11
11
  mode : "textareas",
data/rmce_uploadr.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rmce_uploadr}
8
- s.version = "0.0.1"
8
+ s.version = "0.0.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Alex Vagin"]
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 1
9
- version: 0.0.1
8
+ - 2
9
+ version: 0.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Alex Vagin