├── .gitignore ├── CHANGELOG.md ├── Gemfile ├── LICENSE ├── README.md ├── Rakefile ├── app └── assets │ └── javascripts │ └── tinymce │ └── plugins │ └── uploadimage │ ├── langs │ ├── da.js │ ├── de.js │ ├── en.js │ ├── es.js │ ├── fr.js │ ├── fr_FR.js │ ├── nb.js │ ├── pl.js │ ├── pt.js │ ├── pt_BR.js │ ├── pt_PT.js │ ├── ru.js │ ├── zh-cn.js │ └── zh_TW.js │ └── plugin.js ├── lib ├── tasks │ └── tinymce-uploadimage-assets.rake ├── tinymce-rails-imageupload.rb └── tinymce-rails-imageupload │ ├── rails.rb │ └── version.rb ├── test └── dummy │ ├── .gitignore │ ├── Gemfile │ ├── README.rdoc │ ├── Rakefile │ ├── app │ ├── assets │ │ ├── images │ │ │ └── .keep │ │ ├── javascripts │ │ │ └── application.js │ │ └── stylesheets │ │ │ └── application.css │ ├── controllers │ │ ├── application_controller.rb │ │ ├── concerns │ │ │ └── .keep │ │ └── tinymce_assets_controller.rb │ ├── helpers │ │ └── application_helper.rb │ ├── mailers │ │ └── .keep │ ├── models │ │ ├── .keep │ │ ├── concerns │ │ │ └── .keep │ │ └── image.rb │ └── views │ │ ├── application │ │ └── editor.html.erb │ │ └── layouts │ │ └── application.html.erb │ ├── bin │ ├── bundle │ ├── rails │ └── rake │ ├── config.ru │ ├── config │ ├── application.rb │ ├── boot.rb │ ├── database.yml │ ├── environment.rb │ ├── environments │ │ ├── development.rb │ │ ├── production.rb │ │ └── test.rb │ ├── initializers │ │ ├── backtrace_silencers.rb │ │ ├── filter_parameter_logging.rb │ │ ├── inflections.rb │ │ ├── mime_types.rb │ │ ├── secret_token.rb │ │ ├── session_store.rb │ │ └── wrap_parameters.rb │ ├── locales │ │ └── en.yml │ └── routes.rb │ ├── db │ ├── migrate │ │ └── 20140220155401_create_images.rb │ ├── schema.rb │ └── seeds.rb │ ├── lib │ ├── assets │ │ └── .keep │ └── tasks │ │ └── .keep │ ├── log │ └── .keep │ ├── public │ ├── 404.html │ ├── 422.html │ ├── 500.html │ ├── favicon.ico │ └── robots.txt │ ├── test │ ├── controllers │ │ └── .keep │ ├── fixtures │ │ └── .keep │ ├── helpers │ │ └── .keep │ ├── integration │ │ └── .keep │ ├── mailers │ │ └── .keep │ ├── models │ │ └── .keep │ └── test_helper.rb │ └── vendor │ └── assets │ ├── javascripts │ └── .keep │ └── stylesheets │ └── .keep └── tinymce-rails-imageupload.gemspec /.gitignore: -------------------------------------------------------------------------------- 1 | *.gem 2 | .bundle 3 | Gemfile.lock 4 | pkg/* 5 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # 4.0.0 / unreleased 2 | 3 | * Rewrite the plugin to work with TinyMCE 4. TinyMCE 3.x is supported in the 4 | tinymce3-branch. 5 | 6 | # 3.5.8.5 / 2013-05-07 7 | 8 | * Depend on tinymce-rails ~> 3.5.8.1 for the asset tasks. Thanks to joshcrews (Josh Crews) 9 | This should solve the issue with asset precompilation (#15). 10 | * Add Simplified Chinese (zh-cn) translations. Thanks to inntran (Yinchuan Song) 11 | 12 | # 3.5.8.4 / 2013-04-23 13 | 14 | * Make the plugin work in IE8 and IE9 again. Thanks to pomartel (Pierre Olivier Martel) 15 | * Add German translations. Thanks to pomartel (Pierre Olivier Martel) 16 | * Add Spanish translations. Thanks to pomartel (Pierre Olivier Martel) 17 | 18 | # 3.5.8.3 / 2013-03-18 19 | 20 | * Add option for assigning class to img tag. Thanks to nathanshox (Nathan Shaughnessy) 21 | * Add alt attribute to img tag and input for user to set it. Thanks to nathanshox (Nathan Shaughnessy) 22 | 23 | # 3.5.8.2 / 2013-03-11 24 | 25 | * Added fr-FR translations. Thanks to pompombidou (Harold Simpson) 26 | 27 | # 3.5.8.1 / 2013-02-08 28 | 29 | * Added pt-BR translations. Thanks to klebervirgilio (Kleber Correia) 30 | * Start signing the gem with rubygems-openpgp (https://github.com/grant-olson/rubygems-openpgp) 31 | * My signing key is available at https://eastblue.org/blag/contact/ 32 | 33 | # 3.5.8.0 / 2013-02-01 34 | 35 | * Tested with tinymce-rails 3.5.8 36 | * Handle errors from the server, both in the JSON, and from the server (HTTP 5xx and so on) 37 | * Don't submit the form without a file selected (fixes #1) 38 | * Display a spinner when uploading (fixes #2) 39 | 40 | # 3.5.6.4 / 2012-12-10 41 | 42 | * Convert CoffeeScript to JavaScript to avoid depending on CoffeeScript (#19). Thanks to sobrinho (Gabriel Sobrinho) 43 | 44 | # 3.5.6.3 / 2012-08-27 45 | 46 | * Make the POST URL configurable (#3). Thanks to minaguib (Mina Naguib) 47 | * Make it possible to send extra parameters to the controller (#10). Thanks to minaguib (Mina Naguib) 48 | 49 | # 3.5.6.2 / 2012-08-20 50 | 51 | * Portugese translation. Thanks to Hefesto 52 | * Fix for asset compilation. Thanks to ffloyd (Roman Kolesnev) 53 | 54 | # 3.5.6.1 / 2012-08-09 55 | 56 | * Russian translation. Thanks to ffloyd (Roman Kolesnev) 57 | * `window.opener` is not always available, so fall back to `window.parent` if needed. Thanks to ffloyd (Roman Kolesnev) 58 | 59 | # 3.5.6 / 2012-08-02 60 | 61 | * Relaxed dependency to work with newer tinymce-rails. Thanks to tjoneseng (Tim Jones) 62 | * Fix accessing opener window. Thanks to dpc (Dawid Ciężarkiewicz) 63 | 64 | # 3.4.9.1 / 2012-04-24 65 | 66 | * Work with Rails' CSRF protection by copying the token into our form before submitting it 67 | 68 | # 3.4.9 / 2012-04-05 69 | 70 | * Document how to use I18n with the gem 71 | * Explicitly require tinymce-rails so tinymce-rails-imageupload can be alone in the gemfile 72 | * Update dependency to tinymce-rails 3.4.9 73 | 74 | # 3.4.8.1 / 2012-03-07 75 | 76 | * Added support for setting height and width for the inserted image 77 | 78 | # 3.4.8 / 2012-02-29 79 | 80 | * Initial release 81 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "http://rubygems.org" 2 | 3 | # Specify your gem's dependencies in tinymce-rails-imageupload.gemspec 4 | gemspec 5 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT LICENSE 2 | 3 | Copyright (c) 2011 Per Christian B. Viken 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # IMPORTANT NOTE: 2 | This repository is no longer maintained, as I do not use TinyMCE for anything any more. 3 | I also understand that TinyMCE 4 is quite old. Luckily, [Frank Groeneveld](https://frankgroeneveld.nl) has written [a blog post detailing how to get image uploads working with TinyMCE 6 and Rails](https://frankgroeneveld.nl/2022/07/14/replace-tinymce-rails-imageupload/) that I recommend checking out. 4 | 5 | ~~This version is being rewritten to work with TinyMCE 4.x, and is 6 | currently not very tested. Use at your own risk, feedback welcome. For the stable version targetting TinyMCE 3, see 7 | the [tinymce3 branch](https://github.com/PerfectlyNormal/tinymce-rails-imageupload/tree/tinymce3)~~ 8 | 9 | # tinymce-rails-imageupload 10 | 11 | Simple plugin for TinyMCE that allows uploading images and inserting. 12 | It makes no assumptions about how you store the images, it simply POSTs to a 13 | URL and expects JSON back (see the Setup section). 14 | 15 | This plugin started as a copy of work done by [Peter Shoukry](http://77effects.com/), 16 | but has since mutated into something entirely different. 17 | 18 | Support for TinyMCE 3 is currently available in the [tinymce3 branch](https://github.com/PerfectlyNormal/tinymce-rails-imageupload/tree/tinymce3). 19 | The master branch is targetting TinyMCE 4.x. 20 | 21 | ## Demo 22 | 23 | A small demo app demonstrating a working setup for Rails 3.2 ([demo](http://murmuring-lowlands-1342.herokuapp.com/), [source](https://github.com/PerfectlyNormal/tinymce-rails-imageupload-demo3)), and for Rails 4 ([demo](http://murmuring-lowlands-7502.herokuapp.com/), [source](https://github.com/PerfectlyNormal/tinymce-rails-imageupload-demo)) is available for study. 24 | 25 | ## Requirements 26 | 27 | * Rails >= 3.1 28 | * TinyMCE4 using the advanced theme 29 | 30 | ## Setup 31 | 32 | ### Add the gem to your Gemfile 33 | 34 | gem 'tinymce-rails-imageupload', '~> 4.0.0.beta' 35 | 36 | # or use git 37 | 38 | gem 'tinymce-rails-imageupload', github: 'PerfectlyNormal/tinymce-rails-imageupload' 39 | 40 | ### Set up TinyMCE as you would normally, but in the call to `.tinymce()`, add 41 | 42 | plugins: "uploadimage" 43 | # toolbar option must include "uploadimage" somewhere to have the button appear 44 | 45 | and the rest should happen automatically. 46 | 47 | You can also globally have imageupload globally disabled but enabled on specific instances. 48 | 49 | ~~~yml 50 | # tinymce.yml 51 | toolbar: bold italic underline | uploadimage 52 | plugins: 53 | - uploadimage 54 | uploadimage: false 55 | ~~~ 56 | 57 | ~~~erb 58 | <%= tinymce uploadimage: true %> 59 | ~~~ 60 | 61 | ### Set up upload URL and handler 62 | 63 | The plugin defaults to POSTing to `/tinymce_assets`. You may modify it by 64 | supplying the option `uploadimage_form_url` in the call to `.tinymce()` 65 | 66 | Routing to your controller must be done manually. 67 | Set it up using something similar in `routes.rb`: 68 | 69 | post '/tinymce_assets' => 'tinymce_assets#create' 70 | 71 | This action gets called with a file parameter creatively called `file`, 72 | and must respond with JSON, containing the URL to the image. 73 | 74 | The JSON has to be returned with a content type of "text/html" to work, which 75 | is hopefully going to be fixed ([issue #7](https://github.com/PerfectlyNormal/tinymce-rails-imageupload/issues/7)). 76 | 77 | Example: 78 | 79 | class TinymceAssetsController < ApplicationController 80 | def create 81 | # Take upload from params[:file] and store it somehow... 82 | # Optionally also accept params[:hint] and consume if needed 83 | 84 | render json: { 85 | image: { 86 | url: view_context.image_url(image) 87 | } 88 | }, content_type: "text/html" 89 | end 90 | end 91 | 92 | 93 | If the JSON response contains a `width` and/or `height` key, 94 | those will be used in the inserted HTML (``), 95 | but if those are not present, the inserted HTML is just ``. 96 | 97 | ### Hint param 98 | 99 | Per request `hint` data can be sent to the `create` action through the call to `.tinymce()` or `tinymce.yml`. You may use this to relay any hints you wish (for example, blog post ID #) to the controller. 100 | 101 | - `uploadimage_hint_key` - override the hint key. Default is `hint`. 102 | - `uploadimage_hint` - hint value. 103 | 104 | Example: 105 | 106 | ~~~erb 107 | <%= tinymce uploadimage_hint_key: 'post_id', uploadimage_hint: @post.id %> 108 | ~~~ 109 | 110 | Would result in a `params` object that looks like this: 111 | 112 | ~~~ruby 113 | { 114 | "post_id": 1, 115 | "file": ..., 116 | // ... 117 | } 118 | ~~~ 119 | 120 | ### Model attributes 121 | 122 | Params can be sent in a more standard attributes format by setting `uploadimage_model`. 123 | 124 | - `uploadimage_model` - nest attributes within model namespace. 125 | 126 | Example: 127 | 128 | ~~~erb 129 | <%= tinymce uploadimage_model: 'post' %> 130 | ~~~ 131 | 132 | Would result in a `params` object that looks like this: 133 | 134 | ~~~ruby 135 | { 136 | "post": { 137 | "file": ..., 138 | // ... 139 | }, 140 | } 141 | ~~~ 142 | 143 | ### Default class for img tag 144 | 145 | By default the plugin doesn't assign any class to the img tag. 146 | You can set the class(es) by supplying the `uploadimage_default_img_class` 147 | option in the call to `.tinymce()`. 148 | 149 | `class="..."` will only be added to the img tag if a default or custom class is specified. 150 | Otherwise the inserted HTML is just ``. 151 | 152 | ### Custom classes 153 | 154 | You can set `image_class_list` to an array of `title`, `value` objects to provide uploaders a pre-defined list of CSS classes to apply. 155 | 156 | ~~~yml 157 | # tinymce.yml 158 | image_class_list: 159 | - title: 'Center' 160 | value: 'img-center' 161 | - title: 'Left thumbnail' 162 | value: 'img-left img-thumbnail' 163 | - title: 'Right thumbnail' 164 | value: 'img-right img-thumbnail' 165 | ~~~ 166 | 167 | ## Asset Pipeline 168 | 169 | Several people have had trouble with asset precompilation using the asset pipeline, both for the locales, and the plugin itself. 170 | 171 | Depending on your version of Rails, and the alignment of the moon, it might work out of the box, or you'll have to add something like this in your configuration: 172 | 173 | `config.assets.precompile += %w( tinymce/plugins/uploadimage/plugin.js tinymce/plugins/uploadimage/langs/en.js )` 174 | 175 | Obviously adjust depending on the language or languages you want to use. 176 | 177 | Since TinyMCE doesn't know about the asset pipeline however, you could just place it under `public/`, and that should probably work as well. As with all things Rails and assets related, YMMV. 178 | 179 | ## Error handling 180 | 181 | To notify the uploader that an error occurred, return JSON containing an 182 | `error` key with a `message`. The message gets show in a paragraph with the 183 | ID `error_message`, and the input label gets the class `invalid`. 184 | 185 | Example response: 186 | 187 | "{"error": { 188 | "message": "Invalid file type. Only .jpg, .png and .gif allowed" 189 | }}" 190 | 191 | ## Internationalization 192 | 193 | I18n is taken care of by `tinymce-rails`. 194 | This gem includes strings for `en`, `de`, `es`, `fr`, `nb`, `pt`, `pt_BR`, 195 | `ru` and `zh-cn`. 196 | To add your own language, create the files `.js` in 197 | `app/assets/javascripts/tinymce/plugins/uploadimage/langs` in your 198 | application, or fork the gem and add your own translations there. 199 | 200 | The format and available strings are listed below: 201 | 202 | ### nb.js 203 | 204 | tinyMCE.addI18n('nb', { 205 | 'Insert an image from your computer': 'Sett inn et bilde fra datamaskinen', 206 | 'Insert image': "Sett inn bilde", 207 | 'Choose an image': "Velg et bilde", 208 | 'You must choose a file': "Du m\u00e5 velge en fil", 209 | 'Got a bad response from the server': "Fikk et ugyldig svar fra serveren", 210 | "Didn't get a response from the server": "Fikk ikke svar fra serveren", 211 | 'Insert': "Sett inn", 212 | 'Cancel': "Avbryt", 213 | 'Image description': "Alternativ tekst for bilde", 214 | }); 215 | 216 | ## Versioning 217 | 218 | The major, minor and patch version of this gem will be mirroring the 219 | release of `tinymce-rails` it is tested against. 220 | 221 | ## Signing 222 | 223 | This gem is signed using [rubygems-openpgp](https://github.com/grant-olson/rubygems-openpgp) using [my personal key](https://eastblue.org/blag/contact/), and the fingerprint is also included below. 224 | 225 | pub 4096R/CCFBB9EF 2013-02-01 [expires: 2017-02-01] 226 | Key fingerprint = 6077 34FC 32B6 6041 BF06 43F2 205D 9784 CCFB B9EF 227 | uid Per Christian Bechström Viken 228 | uid [jpeg image of size 6240] 229 | sub 4096R/13C6EED7 2013-02-01 [expires: 2017-02-01] 230 | 231 | ## Licensing 232 | 233 | The plugin is released under the MIT license. 234 | 235 | TinyMCE is released under the LGPL Version 2.1. 236 | 237 | The icon used for the button comes from the icon set Silk from famfamfam, 238 | released under the [Creative Commons Attribution 3.0 License](http://creativecommons.org/licenses/by/3.0/) 239 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require "bundler/gem_tasks" 2 | -------------------------------------------------------------------------------- /app/assets/javascripts/tinymce/plugins/uploadimage/langs/da.js: -------------------------------------------------------------------------------- 1 | tinyMCE.addI18n('da', { 2 | 'Insert an image from your computer': 'Inds\u00e6t billede fra computer', 3 | 'Insert image': "Inds\u00e6t billede", 4 | 'Choose an image': "V\u00e6lg billede", 5 | 'You must choose a file': "Du skal v\u00e6lge en fil", 6 | 'Got a bad response from the server': "Modtog et ugyldigt svar fra serveren", 7 | "Didn't get a response from the server": "Modtog ikke et svar fra serveren", 8 | 'Insert': "Indsæt", 9 | 'Cancel': "Annuller", 10 | 'Image description': "Alternativ billedtekst", 11 | 'Insert an video from your computer': 'Inds\u00e6t video/lyd fra computer', 12 | 'Insert video': "Ind\u00e6t video/lyd", 13 | 'Choose an image': "V\u00e6lg video/lyd" 14 | }); 15 | -------------------------------------------------------------------------------- /app/assets/javascripts/tinymce/plugins/uploadimage/langs/de.js: -------------------------------------------------------------------------------- 1 | tinyMCE.addI18n('de', { 2 | 'Insert an image from your computer': 'Bild vom Computer einfügen', 3 | 'Insert image': 'Bild einfügen', 4 | 'Choose an image': "Bild auswählen", 5 | 'You must choose a file': "Datei auswählen", 6 | 'Got a bad response from the server': "Ungültige Antwort vom Server", 7 | "Didn't get a response from the server": "Server antwortet nicht", 8 | 'Insert': "Einfügen", 9 | 'Cancel': "Abbrechen", 10 | 'Image description': "Bildbeschreibung" 11 | }); 12 | -------------------------------------------------------------------------------- /app/assets/javascripts/tinymce/plugins/uploadimage/langs/en.js: -------------------------------------------------------------------------------- 1 | tinyMCE.addI18n('en', { 2 | 'Insert an image from your computer': 'Insert an image from your computer', 3 | 'Insert image': 'Insert image', 4 | 'Choose an image': "Choose an image", 5 | 'You must choose a file': "You must choose a file", 6 | 'Got a bad response from the server': "Got a bad response from the server", 7 | "Didn't get a response from the server": "Didn't get a response from the server", 8 | 'Insert': "Insert", 9 | 'Cancel': "Cancel", 10 | 'Image description': "Image description", 11 | }); 12 | -------------------------------------------------------------------------------- /app/assets/javascripts/tinymce/plugins/uploadimage/langs/es.js: -------------------------------------------------------------------------------- 1 | tinyMCE.addI18n('es', { 2 | 'Insert an image from your computer': 'Insertar una imagen desde su computadora', 3 | 'Insert image': 'Insertar una imagen', 4 | 'Choose an image': "Elija una imagen", 5 | 'You must choose a file': "Debe elegir un archivo", 6 | 'Got a bad response from the server': "Mala respuesta del servidor", 7 | "Didn't get a response from the server": "No se recibió respuesta del servidor", 8 | 'Insert': "Insertar", 9 | 'Cancel': "Cancelar", 10 | 'Image description': "Descripción de la imagen", 11 | }); -------------------------------------------------------------------------------- /app/assets/javascripts/tinymce/plugins/uploadimage/langs/fr.js: -------------------------------------------------------------------------------- 1 | tinyMCE.addI18n('fr', { 2 | 'Insert an image from your computer': "Envoyer une image de votre ordinateur", 3 | 'Insert image': "Insérer une image", 4 | 'Choose an image': "Choisissez une image", 5 | 'You must choose a file': "Vous devez sélectionner un fichier", 6 | 'Got a bad response from the server': "Le serveur a envoyé une réponse erronée", 7 | "Didn't get a response from the server": "Le serveur n'a pas renvoyé de réponse", 8 | 'Insert': "Insérer", 9 | 'Cancel': "Annuler", 10 | 'Image description': "Description de l'image", 11 | }); 12 | -------------------------------------------------------------------------------- /app/assets/javascripts/tinymce/plugins/uploadimage/langs/fr_FR.js: -------------------------------------------------------------------------------- 1 | tinyMCE.addI18n('fr_FR', { 2 | 'Insert an image from your computer': "Envoyer une image de votre ordinateur", 3 | 'Insert image': "Insérer une image", 4 | 'Choose an image': "Choisissez une image", 5 | 'You must choose a file': "Vous devez sélectionner un fichier", 6 | 'Got a bad response from the server': "Le serveur a envoyé une réponse erronée", 7 | "Didn't get a response from the server": "Le serveur n'a pas renvoyé de réponse", 8 | 'Insert': "Insérer", 9 | 'Cancel': "Annuler", 10 | 'Image description': "Description de l'image", 11 | }); 12 | -------------------------------------------------------------------------------- /app/assets/javascripts/tinymce/plugins/uploadimage/langs/nb.js: -------------------------------------------------------------------------------- 1 | tinyMCE.addI18n('nb', { 2 | 'Insert an image from your computer': 'Sett inn et bilde fra datamaskinen', 3 | 'Insert image': "Sett inn bilde", 4 | 'Choose an image': "Velg et bilde", 5 | 'You must choose a file': "Du m\u00e5 velge en fil", 6 | 'Got a bad response from the server': "Fikk et ugyldig svar fra serveren", 7 | "Didn't get a response from the server": "Fikk ikke svar fra serveren", 8 | 'Insert': "Sett inn", 9 | 'Cancel': "Avbryt", 10 | 'Image description': "Alternativ tekst for bilde", 11 | }); 12 | -------------------------------------------------------------------------------- /app/assets/javascripts/tinymce/plugins/uploadimage/langs/pl.js: -------------------------------------------------------------------------------- 1 | tinyMCE.addI18n('pl', { 2 | 'Insert an image from your computer': 'Wstaw zdjęcie z komputera', 3 | 'Insert image': 'Wstaw zdjęcie', 4 | 'Choose an image': "Wybierz zdjęcie", 5 | 'You must choose a file': "Musisz wybrać plik", 6 | 'Got a bad response from the server': "Niepoprawna odpowiedź serwera", 7 | "Didn't get a response from the server": "Brak odpowiedzi z serwera", 8 | 'Insert': "Wstaw", 9 | 'Cancel': "Anuluj", 10 | 'Image description': "Opis grafiki", 11 | }); 12 | -------------------------------------------------------------------------------- /app/assets/javascripts/tinymce/plugins/uploadimage/langs/pt.js: -------------------------------------------------------------------------------- 1 | tinyMCE.addI18n('pt', { 2 | 'Insert an image from your computer': 'Inserir uma imagem do seu computador', 3 | 'Insert image': 'Inserir imagem', 4 | 'Choose an image': "Escolher uma imagem", 5 | 'You must choose a file': "É necessário seleccionar um ficheiro", 6 | 'Got a bad response from the server': "Resposta inesperada do servidor", 7 | "Didn't get a response from the server": "Não foi obtida uma resposta do servidor", 8 | 'Insert': "Inserir", 9 | 'Cancel': "Cancelar", 10 | 'Image description': "Image description", 11 | }); -------------------------------------------------------------------------------- /app/assets/javascripts/tinymce/plugins/uploadimage/langs/pt_BR.js: -------------------------------------------------------------------------------- 1 | tinyMCE.addI18n('pt_BR', { 2 | 'Insert an image from your computer': 'Inserir uma imagem do computador', 3 | 'Insert image': 'Inserir imagem', 4 | 'Choose an image': "Escolher uma imagem", 5 | 'You must choose a file': "É necessário selecionar um diretório", 6 | 'Got a bad response from the server': "Resposta inesperada do servidor", 7 | "Didn't get a response from the server": "Servidor não está respondendo", 8 | 'Insert': "Inserir", 9 | 'Cancel': "Cancelar", 10 | 'Image description': "Descrição da imagem", 11 | }); 12 | -------------------------------------------------------------------------------- /app/assets/javascripts/tinymce/plugins/uploadimage/langs/pt_PT.js: -------------------------------------------------------------------------------- 1 | tinyMCE.addI18n('pt_PT', { 2 | 'Insert an image from your computer': 'Inserir uma imagem do seu computador', 3 | 'Insert image': 'Inserir imagem', 4 | 'Choose an image': "Escolher uma imagem", 5 | 'You must choose a file': "É necessário seleccionar um ficheiro", 6 | 'Got a bad response from the server': "Resposta inesperada do servidor", 7 | "Didn't get a response from the server": "Não foi obtida uma resposta do servidor", 8 | 'Insert': "Inserir", 9 | 'Cancel': "Cancelar", 10 | 'Image description': "Descrição da imagem", 11 | }); 12 | -------------------------------------------------------------------------------- /app/assets/javascripts/tinymce/plugins/uploadimage/langs/ru.js: -------------------------------------------------------------------------------- 1 | tinyMCE.addI18n('ru', { 2 | 'Insert an image from your computer': 'Вставить изображение с вашего компьютера', 3 | 'Insert image': "Вставить изображение", 4 | 'Choose an image': "Изображение", 5 | 'You must choose a file': "Необходимо выбрать файл", 6 | 'Got a bad response from the server': "Получен некорректный ответ с сервера", 7 | "Didn't get a response from the server": "Не получен ответ с сервера", 8 | 'Insert': "Вставить", 9 | 'Cancel': "Отмена", 10 | 'Image description': "Информация", 11 | }); 12 | -------------------------------------------------------------------------------- /app/assets/javascripts/tinymce/plugins/uploadimage/langs/zh-cn.js: -------------------------------------------------------------------------------- 1 | tinyMCE.addI18n('zh-cn', { 2 | 'Insert an image from your computer': "\u4e0a\u4f20\u56fe\u7247", 3 | 'Insert image': "\u63d2\u5165\u56fe\u7247", 4 | 'Choose an image': "\u9009\u62e9\u56fe\u7247", 5 | 'You must choose a file': "\u5fc5\u987b\u9009\u62e9\u6587\u4ef6", 6 | 'Got a bad response from the server': "\u670d\u52a1\u5668\u8fd4\u56de\u9519\u8bef", 7 | "Didn't get a response from the server": "\u670d\u52a1\u5668\u6ca1\u6709\u54cd\u5e94", 8 | 'Insert': "\u63d2\u5165", 9 | 'Cancel': "\u53d6\u6d88", 10 | 'Image description': "\u56fe\u7247\u63cf\u8ff0", 11 | }); 12 | -------------------------------------------------------------------------------- /app/assets/javascripts/tinymce/plugins/uploadimage/langs/zh_TW.js: -------------------------------------------------------------------------------- 1 | tinyMCE.addI18n("zh-TW", { 2 | "Insert an image from your computer": "上傳圖片", 3 | "Insert image": "插入圖片", 4 | "Choose an image": "選擇圖片", 5 | "You must choose a file": "須選擇一張圖片", 6 | "Got a bad response from the server": "伺服器回傳錯誤", 7 | "Didn't get a response from the server": "伺服器沒有回應", 8 | "Insert": "插入", 9 | "Cancel": "取消", 10 | "Image description": "圖片敘述", 11 | }); 12 | -------------------------------------------------------------------------------- /app/assets/javascripts/tinymce/plugins/uploadimage/plugin.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | tinymce.PluginManager.requireLangPack('uploadimage'); 3 | 4 | tinymce.create('tinymce.plugins.UploadImage', { 5 | UploadImage: function(ed, url) { 6 | var form, 7 | iframe, 8 | win, 9 | throbber, 10 | selectedClass = '', 11 | editor = ed; 12 | 13 | function showDialog() { 14 | var classList = getClassList(); 15 | var body = [ 16 | { type: 'iframe', url: 'javascript:void(0)' }, 17 | { type: 'textbox', name: 'file', label: ed.translate('Choose an image'), subtype: 'file' }, 18 | { type: 'textbox', name: 'alt', label: ed.translate('Image description') } 19 | ]; 20 | 21 | if (classList.length > 0) { 22 | selectedClass = classList[0].value; 23 | body = body.concat([ 24 | { 25 | type: 'listbox', 26 | name: 'class', 27 | label: ed.translate('Class'), 28 | values: classList, 29 | onSelect: function(e) { 30 | selectedClass = this.value(); 31 | } 32 | } 33 | ]); 34 | } 35 | 36 | body = body.concat([ 37 | { type: 'container', classes: 'error', html: "

 

" }, 38 | 39 | // Trick TinyMCE to add a empty div that "preloads" the throbber image 40 | { type: 'container', classes: 'throbber' } 41 | ]); 42 | 43 | win = editor.windowManager.open( 44 | { 45 | title: ed.translate('Insert an image from your computer'), 46 | width: 520 + parseInt(editor.getLang('uploadimage.delta_width', 0), 10), 47 | height: 180 + parseInt(editor.getLang('uploadimage.delta_height', 0), 10), 48 | body: body, 49 | buttons: [ 50 | { 51 | text: ed.translate('Insert'), 52 | onclick: insertImage, 53 | subtype: 'primary' 54 | }, 55 | { 56 | text: ed.translate('Cancel'), 57 | onclick: ed.windowManager.close 58 | } 59 | ] 60 | }, 61 | { 62 | plugin_url: url 63 | } 64 | ); 65 | 66 | /* WHY DO YOU HATE
, TINYMCE!? */ 67 | iframe = win.find('iframe')[0]; 68 | form = createElement('form', { 69 | action: ed.getParam('uploadimage_form_url', '/tinymce_assets'), 70 | target: iframe._id, 71 | method: 'POST', 72 | enctype: 'multipart/form-data', 73 | accept_charset: 'UTF-8' 74 | }); 75 | 76 | // Might have several instances on the same page, 77 | // so we TinyMCE create unique IDs and use those. 78 | iframe.getEl().name = iframe._id; 79 | 80 | // Create some needed hidden inputs 81 | form.appendChild(createElement('input', { type: 'hidden', name: 'utf8', value: '✓' })); 82 | form.appendChild( 83 | createElement('input', { type: 'hidden', name: 'authenticity_token', value: getMetaContents('csrf-token') }) 84 | ); 85 | form.appendChild(createElement('input', { type: 'hidden', name: hintName(), value: hintValue() })); 86 | 87 | var el = win.getEl(); 88 | var body = document.getElementById(el.id + '-body'); 89 | 90 | // Copy everything TinyMCE made into our form 91 | var containers = body.getElementsByClassName('mce-container'); 92 | for (var i = 0; i < containers.length; i++) { 93 | form.appendChild(containers[i]); 94 | } 95 | 96 | // Fix inputs, since TinyMCE hates HTML and forms 97 | var inputs = form.getElementsByTagName('input'); 98 | for (var i = 0; i < inputs.length; i++) { 99 | var ctrl = inputs[i]; 100 | 101 | if (ctrl.tagName.toLowerCase() === 'input' && ctrl.type !== 'hidden') { 102 | if (ctrl.type === 'file') { 103 | ctrl.name = inputName('file'); 104 | 105 | // Hack styles 106 | tinymce.DOM.setStyles(ctrl, { 107 | border: 0, 108 | boxShadow: 'none', 109 | webkitBoxShadow: 'none' 110 | }); 111 | } else { 112 | ctrl.name = inputName('alt'); 113 | } 114 | } 115 | } 116 | 117 | body.appendChild(form); 118 | } 119 | 120 | function hintName() { 121 | return inputName(ed.getParam('uploadimage_hint_key', 'hint')); 122 | } 123 | 124 | function hintValue() { 125 | return ed.getParam('uploadimage_hint', ''); 126 | } 127 | 128 | function inputName(name) { 129 | if (ed.getParam('uploadimage_model', false)) { 130 | return ed.getParam('uploadimage_model') + '[' + name + ']'; 131 | } else { 132 | return name; 133 | } 134 | } 135 | 136 | function insertImage() { 137 | if (getInputValue(inputName('file')) === '') { 138 | return handleError('You must choose a file'); 139 | } 140 | 141 | throbber = new top.tinymce.ui.Throbber(win.getEl()); 142 | throbber.show(); 143 | 144 | clearErrors(); 145 | 146 | /* Add event listeners. 147 | * We remove the existing to avoid them being called twice in case 148 | * of errors and re-submitting afterwards. 149 | */ 150 | var target = iframe.getEl(); 151 | if (target.attachEvent) { 152 | target.detachEvent('onload', uploadDone); 153 | target.attachEvent('onload', uploadDone); 154 | } else { 155 | target.removeEventListener('load', uploadDone); 156 | target.addEventListener('load', uploadDone, false); 157 | } 158 | 159 | form.submit(); 160 | } 161 | 162 | function uploadDone() { 163 | if (throbber) { 164 | throbber.hide(); 165 | } 166 | try { 167 | var target = iframe.getEl(); 168 | if (target.document || target.contentDocument) { 169 | var doc = target.contentDocument || target.contentWindow.document; 170 | if (String(doc.contentType).indexOf('html') > -1) { 171 | handleResponse(doc.getElementsByTagName('body')[0].innerHTML); 172 | } else { 173 | handleResponse(doc.getElementsByTagName('pre')[0].innerHTML); 174 | } 175 | } 176 | } catch (e) { 177 | handleError("Didn't get a response from the server"); 178 | } 179 | } 180 | 181 | function handleResponse(ret) { 182 | try { 183 | var json = tinymce.util.JSON.parse(ret); 184 | 185 | if (json['error']) { 186 | handleError(json['error']['message']); 187 | } else { 188 | ed.execCommand('mceInsertContent', false, buildHTML(json)); 189 | ed.windowManager.close(); 190 | } 191 | } catch (e) { 192 | handleError('Got a bad response from the server'); 193 | } 194 | } 195 | 196 | function clearErrors() { 197 | var message = win.find('.error')[0].getEl(); 198 | 199 | if (message) { 200 | message.getElementsByTagName('p')[0].innerHTML = ' '; 201 | } 202 | } 203 | 204 | function handleError(error) { 205 | var message = win.find('.error')[0].getEl(); 206 | 207 | if (message) { 208 | message.getElementsByTagName('p')[0].innerHTML = ed.translate(error); 209 | } 210 | } 211 | 212 | function createElement(element, attributes) { 213 | var el = document.createElement(element); 214 | for (var property in attributes) { 215 | if (!(attributes[property] instanceof Function)) { 216 | el[property] = attributes[property]; 217 | } 218 | } 219 | 220 | return el; 221 | } 222 | 223 | function buildHTML(json) { 224 | var image = json[ed.getParam('uploadimage_model', 'image')]; 225 | var defaultClass = ed.getParam('uploadimage_default_img_class', ''); 226 | var figure = ed.getParam('uploadimage_figure', false); 227 | var altText = getInputValue(inputName('alt')); 228 | 229 | var imgstr = ""; 243 | 244 | if (figure) { 245 | var figureClass = ed.getParam('uploadimage_figure_class', 'figure'); 246 | var figcaptionClass = ed.getParam('uploadimage_figcaption_class', 'figcaption'); 247 | 248 | var figstr = ''; 259 | figstr += ''; 260 | 261 | return figstr; 262 | } else { 263 | return imgstr; 264 | } 265 | } 266 | 267 | function getInputValue(name) { 268 | var inputs = form.getElementsByTagName('input'); 269 | 270 | for (var i in inputs) { 271 | if (inputs[i].name === name) { 272 | return inputs[i].value; 273 | } 274 | } 275 | 276 | return ''; 277 | } 278 | 279 | function getMetaContents(mn) { 280 | var m = document.getElementsByTagName('meta'); 281 | 282 | for (var i in m) { 283 | if (m[i].name === mn) { 284 | return m[i].content; 285 | } 286 | } 287 | 288 | return null; 289 | } 290 | 291 | function getClassList() { 292 | var config = ed.getParam('image_class_list', []); 293 | var values = []; 294 | for (var i = 0; i < config.length; i++) { 295 | values[i] = { 296 | text: config[i]['title'], 297 | value: config[i]['value'] 298 | }; 299 | } 300 | return values; 301 | } 302 | 303 | if (editor.getParam('uploadimage', true)) { 304 | // Add a button that opens a window 305 | editor.addButton('uploadimage', { 306 | tooltip: ed.translate('Insert an image from your computer'), 307 | icon: 'image', 308 | onclick: showDialog 309 | }); 310 | 311 | // Adds a menu item to the tools menu 312 | editor.addMenuItem('uploadimage', { 313 | text: ed.translate('Insert an image from your computer'), 314 | icon: 'image', 315 | context: 'insert', 316 | onclick: showDialog 317 | }); 318 | } 319 | } 320 | }); 321 | 322 | tinymce.PluginManager.add('uploadimage', tinymce.plugins.UploadImage); 323 | })(); 324 | -------------------------------------------------------------------------------- /lib/tasks/tinymce-uploadimage-assets.rake: -------------------------------------------------------------------------------- 1 | assets_task = 'assets:precompile' 2 | 3 | Rake::Task[assets_task].enhance do 4 | require "tinymce/rails/asset_installer" 5 | 6 | assets = Pathname.new(File.expand_path(File.dirname(__FILE__) + "/../../app/assets/javascripts/tinymce")) 7 | 8 | config = Rails.application.config 9 | target = File.join(Rails.public_path, config.assets.prefix) 10 | manifest = config.assets.manifest 11 | 12 | installer = TinyMCE::Rails::AssetInstaller.new(assets, target, manifest) 13 | installer.log_level = Logger::INFO 14 | installer.strategy = config.tinymce.install 15 | installer.install 16 | end 17 | -------------------------------------------------------------------------------- /lib/tinymce-rails-imageupload.rb: -------------------------------------------------------------------------------- 1 | require "tinymce-rails" 2 | require "tinymce-rails-imageupload/version" 3 | require "tinymce-rails-imageupload/rails" -------------------------------------------------------------------------------- /lib/tinymce-rails-imageupload/rails.rb: -------------------------------------------------------------------------------- 1 | module Tinymce 2 | module Rails 3 | module Imageupload 4 | class Engine < ::Rails::Engine 5 | initializer 'TinymceRailsImageupload.assets_pipeline' do |app| 6 | app.config.assets.precompile << "tinymce/plugins/uploadimage/*" 7 | end 8 | end 9 | end 10 | end 11 | end -------------------------------------------------------------------------------- /lib/tinymce-rails-imageupload/version.rb: -------------------------------------------------------------------------------- 1 | module Tinymce 2 | module Rails 3 | module Imageupload 4 | VERSION = "4.0.17.beta.3" 5 | end 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /test/dummy/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files for more about ignoring files. 2 | # 3 | # If you find yourself ignoring temporary files generated by your text editor 4 | # or operating system, you probably want to add a global ignore instead: 5 | # git config --global core.excludesfile '~/.gitignore_global' 6 | 7 | # Ignore bundler config. 8 | /.bundle 9 | 10 | # Ignore the default SQLite database. 11 | /db/*.sqlite3 12 | /db/*.sqlite3-journal 13 | 14 | # Ignore all logfiles and tempfiles. 15 | /log/*.log 16 | /tmp 17 | -------------------------------------------------------------------------------- /test/dummy/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 4 | gem 'rails', '4.0.2' 5 | 6 | # Use sqlite3 as the database for Active Record 7 | gem 'sqlite3' 8 | 9 | # Use SCSS for stylesheets 10 | gem 'sass-rails', '~> 4.0.0' 11 | 12 | # Use Uglifier as compressor for JavaScript assets 13 | gem 'uglifier', '>= 1.3.0' 14 | 15 | # Use CoffeeScript for .js.coffee assets and views 16 | gem 'coffee-rails', '~> 4.0.0' 17 | 18 | # See https://github.com/sstephenson/execjs#readme for more supported runtimes 19 | # gem 'therubyracer', platforms: :ruby 20 | 21 | # Use jquery as the JavaScript library 22 | gem 'jquery-rails' 23 | 24 | # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks 25 | gem 'turbolinks' 26 | 27 | # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 28 | gem 'jbuilder', '~> 1.2' 29 | 30 | group :doc do 31 | # bundle exec rake doc:rails generates the API under doc/api. 32 | gem 'sdoc', require: false 33 | end 34 | 35 | # Use ActiveModel has_secure_password 36 | # gem 'bcrypt-ruby', '~> 3.1.2' 37 | 38 | # Use unicorn as the app server 39 | # gem 'unicorn' 40 | 41 | # Use Capistrano for deployment 42 | # gem 'capistrano', group: :development 43 | 44 | # Use debugger 45 | # gem 'debugger', group: [:development, :test] 46 | 47 | gem 'tinymce-rails-imageupload', path: '../../' 48 | gem 'paperclip' -------------------------------------------------------------------------------- /test/dummy/README.rdoc: -------------------------------------------------------------------------------- 1 | == README 2 | 3 | This README would normally document whatever steps are necessary to get the 4 | application up and running. 5 | 6 | Things you may want to cover: 7 | 8 | * Ruby version 9 | 10 | * System dependencies 11 | 12 | * Configuration 13 | 14 | * Database creation 15 | 16 | * Database initialization 17 | 18 | * How to run the test suite 19 | 20 | * Services (job queues, cache servers, search engines, etc.) 21 | 22 | * Deployment instructions 23 | 24 | * ... 25 | 26 | 27 | Please feel free to use a different markup language if you do not plan to run 28 | rake doc:app. 29 | -------------------------------------------------------------------------------- /test/dummy/Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require File.expand_path('../config/application', __FILE__) 5 | 6 | Dummy::Application.load_tasks 7 | -------------------------------------------------------------------------------- /test/dummy/app/assets/images/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerfectlyNormal/tinymce-rails-imageupload/444da5d06762ea48c15e132c10b871d2d321c713/test/dummy/app/assets/images/.keep -------------------------------------------------------------------------------- /test/dummy/app/assets/javascripts/application.js: -------------------------------------------------------------------------------- 1 | // This is a manifest file that'll be compiled into application.js, which will include all the files 2 | // listed below. 3 | // 4 | // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, 5 | // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. 6 | // 7 | // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the 8 | // compiled file. 9 | // 10 | // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details 11 | // about supported directives. 12 | // 13 | //= require jquery 14 | //= require jquery_ujs 15 | //= require tinymce-jquery 16 | //= require turbolinks 17 | //= require_self 18 | 19 | $("document:ready", function() { 20 | $("[rel=tinymce]").tinymce({ 21 | theme: "modern", 22 | toolbar: "bold,italic,underline,|,bullist,numlist,outdent,indent,|,undo,redo,|,pastetext,pasteword,selectall,|,uploadimage", 23 | pagebreak_separator: "

 

", 24 | plugins: ["uploadimage"], 25 | relative_urls: false, 26 | remove_script_host: false, 27 | document_base_url: (!window.location.origin ? window.location.protocol + "//" + window.location.host : window.location.origin) + "/", 28 | }) 29 | }); -------------------------------------------------------------------------------- /test/dummy/app/assets/stylesheets/application.css: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a manifest file that'll be compiled into application.css, which will include all the files 3 | * listed below. 4 | * 5 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, 6 | * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. 7 | * 8 | * You're free to add application-wide styles to this file and they'll appear at the top of the 9 | * compiled file, but it's generally better to create a new file per style scope. 10 | * 11 | *= require_self 12 | *= require_tree . 13 | */ 14 | -------------------------------------------------------------------------------- /test/dummy/app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | # Prevent CSRF attacks by raising an exception. 3 | # For APIs, you may want to use :null_session instead. 4 | protect_from_forgery with: :exception 5 | 6 | def editor 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /test/dummy/app/controllers/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerfectlyNormal/tinymce-rails-imageupload/444da5d06762ea48c15e132c10b871d2d321c713/test/dummy/app/controllers/concerns/.keep -------------------------------------------------------------------------------- /test/dummy/app/controllers/tinymce_assets_controller.rb: -------------------------------------------------------------------------------- 1 | class TinymceAssetsController < ApplicationController 2 | respond_to :json 3 | 4 | def create 5 | geometry = Paperclip::Geometry.from_file params[:file] 6 | image = Image.create params.permit(:file, :alt, :hint) 7 | 8 | render json: { 9 | image: { 10 | url: image.file.url, 11 | height: geometry.height.to_i, 12 | width: geometry.width.to_i 13 | } 14 | }, layout: false, content_type: "application/json" 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /test/dummy/app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /test/dummy/app/mailers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerfectlyNormal/tinymce-rails-imageupload/444da5d06762ea48c15e132c10b871d2d321c713/test/dummy/app/mailers/.keep -------------------------------------------------------------------------------- /test/dummy/app/models/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerfectlyNormal/tinymce-rails-imageupload/444da5d06762ea48c15e132c10b871d2d321c713/test/dummy/app/models/.keep -------------------------------------------------------------------------------- /test/dummy/app/models/concerns/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerfectlyNormal/tinymce-rails-imageupload/444da5d06762ea48c15e132c10b871d2d321c713/test/dummy/app/models/concerns/.keep -------------------------------------------------------------------------------- /test/dummy/app/models/image.rb: -------------------------------------------------------------------------------- 1 | class Image < ActiveRecord::Base 2 | has_attached_file :file 3 | end -------------------------------------------------------------------------------- /test/dummy/app/views/application/editor.html.erb: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/dummy/app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Dummy 5 | <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %> 6 | <%= javascript_include_tag "application", "data-turbolinks-track" => true %> 7 | <%= csrf_meta_tags %> 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /test/dummy/bin/bundle: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | load Gem.bin_path('bundler', 'bundle') 4 | -------------------------------------------------------------------------------- /test/dummy/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_PATH = File.expand_path('../../config/application', __FILE__) 3 | require_relative '../config/boot' 4 | require 'rails/commands' 5 | -------------------------------------------------------------------------------- /test/dummy/bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require_relative '../config/boot' 3 | require 'rake' 4 | Rake.application.run 5 | -------------------------------------------------------------------------------- /test/dummy/config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require ::File.expand_path('../config/environment', __FILE__) 4 | run Rails.application 5 | -------------------------------------------------------------------------------- /test/dummy/config/application.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../boot', __FILE__) 2 | 3 | require 'rails/all' 4 | 5 | # Require the gems listed in Gemfile, including any gems 6 | # you've limited to :test, :development, or :production. 7 | Bundler.require(:default, Rails.env) 8 | 9 | module Dummy 10 | class Application < Rails::Application 11 | # Settings in config/environments/* take precedence over those specified here. 12 | # Application configuration should go into files in config/initializers 13 | # -- all .rb files in that directory are automatically loaded. 14 | 15 | # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. 16 | # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. 17 | # config.time_zone = 'Central Time (US & Canada)' 18 | 19 | # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. 20 | # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] 21 | # config.i18n.default_locale = :de 22 | end 23 | end 24 | -------------------------------------------------------------------------------- /test/dummy/config/boot.rb: -------------------------------------------------------------------------------- 1 | # Set up gems listed in the Gemfile. 2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) 3 | 4 | require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE']) 5 | -------------------------------------------------------------------------------- /test/dummy/config/database.yml: -------------------------------------------------------------------------------- 1 | # SQLite version 3.x 2 | # gem install sqlite3 3 | # 4 | # Ensure the SQLite 3 gem is defined in your Gemfile 5 | # gem 'sqlite3' 6 | development: 7 | adapter: sqlite3 8 | database: db/development.sqlite3 9 | pool: 5 10 | timeout: 5000 11 | 12 | # Warning: The database defined as "test" will be erased and 13 | # re-generated from your development database when you run "rake". 14 | # Do not set this db to the same as development or production. 15 | test: 16 | adapter: sqlite3 17 | database: db/test.sqlite3 18 | pool: 5 19 | timeout: 5000 20 | 21 | production: 22 | adapter: sqlite3 23 | database: db/production.sqlite3 24 | pool: 5 25 | timeout: 5000 26 | -------------------------------------------------------------------------------- /test/dummy/config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require File.expand_path('../application', __FILE__) 3 | 4 | # Initialize the Rails application. 5 | Dummy::Application.initialize! 6 | -------------------------------------------------------------------------------- /test/dummy/config/environments/development.rb: -------------------------------------------------------------------------------- 1 | Dummy::Application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # In the development environment your application's code is reloaded on 5 | # every request. This slows down response time but is perfect for development 6 | # since you don't have to restart the web server when you make code changes. 7 | config.cache_classes = false 8 | 9 | # Do not eager load code on boot. 10 | config.eager_load = false 11 | 12 | # Show full error reports and disable caching. 13 | config.consider_all_requests_local = true 14 | config.action_controller.perform_caching = false 15 | 16 | # Don't care if the mailer can't send. 17 | config.action_mailer.raise_delivery_errors = false 18 | 19 | # Print deprecation notices to the Rails logger. 20 | config.active_support.deprecation = :log 21 | 22 | # Raise an error on page load if there are pending migrations 23 | config.active_record.migration_error = :page_load 24 | 25 | # Debug mode disables concatenation and preprocessing of assets. 26 | # This option may cause significant delays in view rendering with a large 27 | # number of complex assets. 28 | config.assets.debug = true 29 | end 30 | -------------------------------------------------------------------------------- /test/dummy/config/environments/production.rb: -------------------------------------------------------------------------------- 1 | Dummy::Application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # Code is not reloaded between requests. 5 | config.cache_classes = true 6 | 7 | # Eager load code on boot. This eager loads most of Rails and 8 | # your application in memory, allowing both thread web servers 9 | # and those relying on copy on write to perform better. 10 | # Rake tasks automatically ignore this option for performance. 11 | config.eager_load = true 12 | 13 | # Full error reports are disabled and caching is turned on. 14 | config.consider_all_requests_local = false 15 | config.action_controller.perform_caching = true 16 | 17 | # Enable Rack::Cache to put a simple HTTP cache in front of your application 18 | # Add `rack-cache` to your Gemfile before enabling this. 19 | # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid. 20 | # config.action_dispatch.rack_cache = true 21 | 22 | # Disable Rails's static asset server (Apache or nginx will already do this). 23 | config.serve_static_assets = false 24 | 25 | # Compress JavaScripts and CSS. 26 | config.assets.js_compressor = :uglifier 27 | # config.assets.css_compressor = :sass 28 | 29 | # Do not fallback to assets pipeline if a precompiled asset is missed. 30 | config.assets.compile = false 31 | 32 | # Generate digests for assets URLs. 33 | config.assets.digest = true 34 | 35 | # Version of your assets, change this if you want to expire all your assets. 36 | config.assets.version = '1.0' 37 | 38 | # Specifies the header that your server uses for sending files. 39 | # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache 40 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx 41 | 42 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. 43 | # config.force_ssl = true 44 | 45 | # Set to :debug to see everything in the log. 46 | config.log_level = :info 47 | 48 | # Prepend all log lines with the following tags. 49 | # config.log_tags = [ :subdomain, :uuid ] 50 | 51 | # Use a different logger for distributed setups. 52 | # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new) 53 | 54 | # Use a different cache store in production. 55 | # config.cache_store = :mem_cache_store 56 | 57 | # Enable serving of images, stylesheets, and JavaScripts from an asset server. 58 | # config.action_controller.asset_host = "http://assets.example.com" 59 | 60 | # Precompile additional assets. 61 | # application.js, application.css, and all non-JS/CSS in app/assets folder are already added. 62 | # config.assets.precompile += %w( search.js ) 63 | 64 | # Ignore bad email addresses and do not raise email delivery errors. 65 | # Set this to true and configure the email server for immediate delivery to raise delivery errors. 66 | # config.action_mailer.raise_delivery_errors = false 67 | 68 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to 69 | # the I18n.default_locale when a translation can not be found). 70 | config.i18n.fallbacks = true 71 | 72 | # Send deprecation notices to registered listeners. 73 | config.active_support.deprecation = :notify 74 | 75 | # Disable automatic flushing of the log to improve performance. 76 | # config.autoflush_log = false 77 | 78 | # Use default logging formatter so that PID and timestamp are not suppressed. 79 | config.log_formatter = ::Logger::Formatter.new 80 | end 81 | -------------------------------------------------------------------------------- /test/dummy/config/environments/test.rb: -------------------------------------------------------------------------------- 1 | Dummy::Application.configure do 2 | # Settings specified here will take precedence over those in config/application.rb. 3 | 4 | # The test environment is used exclusively to run your application's 5 | # test suite. You never need to work with it otherwise. Remember that 6 | # your test database is "scratch space" for the test suite and is wiped 7 | # and recreated between test runs. Don't rely on the data there! 8 | config.cache_classes = true 9 | 10 | # Do not eager load code on boot. This avoids loading your whole application 11 | # just for the purpose of running a single test. If you are using a tool that 12 | # preloads Rails for running tests, you may have to set it to true. 13 | config.eager_load = false 14 | 15 | # Configure static asset server for tests with Cache-Control for performance. 16 | config.serve_static_assets = true 17 | config.static_cache_control = "public, max-age=3600" 18 | 19 | # Show full error reports and disable caching. 20 | config.consider_all_requests_local = true 21 | config.action_controller.perform_caching = false 22 | 23 | # Raise exceptions instead of rendering exception templates. 24 | config.action_dispatch.show_exceptions = false 25 | 26 | # Disable request forgery protection in test environment. 27 | config.action_controller.allow_forgery_protection = false 28 | 29 | # Tell Action Mailer not to deliver emails to the real world. 30 | # The :test delivery method accumulates sent emails in the 31 | # ActionMailer::Base.deliveries array. 32 | config.action_mailer.delivery_method = :test 33 | 34 | # Print deprecation notices to the stderr. 35 | config.active_support.deprecation = :stderr 36 | end 37 | -------------------------------------------------------------------------------- /test/dummy/config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. 7 | # Rails.backtrace_cleaner.remove_silencers! 8 | -------------------------------------------------------------------------------- /test/dummy/config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure sensitive parameters which will be filtered from the log file. 4 | Rails.application.config.filter_parameters += [:password] 5 | -------------------------------------------------------------------------------- /test/dummy/config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format. Inflections 4 | # are locale specific, and you may define rules for as many different 5 | # locales as you wish. All of these examples are active by default: 6 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 7 | # inflect.plural /^(ox)$/i, '\1en' 8 | # inflect.singular /^(ox)en/i, '\1' 9 | # inflect.irregular 'person', 'people' 10 | # inflect.uncountable %w( fish sheep ) 11 | # end 12 | 13 | # These inflection rules are supported but not enabled by default: 14 | # ActiveSupport::Inflector.inflections(:en) do |inflect| 15 | # inflect.acronym 'RESTful' 16 | # end 17 | -------------------------------------------------------------------------------- /test/dummy/config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | # Mime::Type.register_alias "text/html", :iphone 6 | -------------------------------------------------------------------------------- /test/dummy/config/initializers/secret_token.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Your secret key is used for verifying the integrity of signed cookies. 4 | # If you change this key, all old signed cookies will become invalid! 5 | 6 | # Make sure the secret is at least 30 characters and all random, 7 | # no regular words or you'll be exposed to dictionary attacks. 8 | # You can use `rake secret` to generate a secure secret key. 9 | 10 | # Make sure your secret_key_base is kept private 11 | # if you're sharing your code publicly. 12 | Dummy::Application.config.secret_key_base = '86469c58f09ff72d35a198e6d57fe5982732ac56d3717b26157804cf0f8d4d90f3c905ffb979e824841a4cd5b247e640b037cd4981e44788b04fc7b26f5fe6a1' 13 | -------------------------------------------------------------------------------- /test/dummy/config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Dummy::Application.config.session_store :cookie_store, key: '_dummy_session' 4 | -------------------------------------------------------------------------------- /test/dummy/config/initializers/wrap_parameters.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # This file contains settings for ActionController::ParamsWrapper which 4 | # is enabled by default. 5 | 6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. 7 | ActiveSupport.on_load(:action_controller) do 8 | wrap_parameters format: [:json] if respond_to?(:wrap_parameters) 9 | end 10 | 11 | # To enable root element in JSON for ActiveRecord objects. 12 | # ActiveSupport.on_load(:active_record) do 13 | # self.include_root_in_json = true 14 | # end 15 | -------------------------------------------------------------------------------- /test/dummy/config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Files in the config/locales directory are used for internationalization 2 | # and are automatically loaded by Rails. If you want to use locales other 3 | # than English, add the necessary files in this directory. 4 | # 5 | # To use the locales, use `I18n.t`: 6 | # 7 | # I18n.t 'hello' 8 | # 9 | # In views, this is aliased to just `t`: 10 | # 11 | # <%= t('hello') %> 12 | # 13 | # To use a different locale, set it with `I18n.locale`: 14 | # 15 | # I18n.locale = :es 16 | # 17 | # This would use the information in config/locales/es.yml. 18 | # 19 | # To learn more, please read the Rails Internationalization guide 20 | # available at http://guides.rubyonrails.org/i18n.html. 21 | 22 | en: 23 | hello: "Hello world" 24 | -------------------------------------------------------------------------------- /test/dummy/config/routes.rb: -------------------------------------------------------------------------------- 1 | Dummy::Application.routes.draw do 2 | post '/tinymce_assets' => 'tinymce_assets#create' 3 | 4 | root to: 'application#editor' 5 | end 6 | -------------------------------------------------------------------------------- /test/dummy/db/migrate/20140220155401_create_images.rb: -------------------------------------------------------------------------------- 1 | class CreateImages < ActiveRecord::Migration 2 | def change 3 | create_table :images do |t| 4 | t.string :alt, default: "" 5 | t.string :hint, default: "" 6 | t.attachment :file 7 | t.timestamps 8 | end 9 | end 10 | end -------------------------------------------------------------------------------- /test/dummy/db/schema.rb: -------------------------------------------------------------------------------- 1 | # encoding: UTF-8 2 | # This file is auto-generated from the current state of the database. Instead 3 | # of editing this file, please use the migrations feature of Active Record to 4 | # incrementally modify your database, and then regenerate this schema definition. 5 | # 6 | # Note that this schema.rb definition is the authoritative source for your 7 | # database schema. If you need to create the application database on another 8 | # system, you should be using db:schema:load, not running all the migrations 9 | # from scratch. The latter is a flawed and unsustainable approach (the more migrations 10 | # you'll amass, the slower it'll run and the greater likelihood for issues). 11 | # 12 | # It's strongly recommended that you check this file into your version control system. 13 | 14 | ActiveRecord::Schema.define(version: 20140220155401) do 15 | 16 | create_table "images", force: true do |t| 17 | t.string "alt", default: "" 18 | t.string "hint", default: "" 19 | t.string "file_file_name" 20 | t.string "file_content_type" 21 | t.integer "file_file_size" 22 | t.datetime "file_updated_at" 23 | t.datetime "created_at" 24 | t.datetime "updated_at" 25 | end 26 | 27 | end 28 | -------------------------------------------------------------------------------- /test/dummy/db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) 7 | # Mayor.create(name: 'Emanuel', city: cities.first) 8 | -------------------------------------------------------------------------------- /test/dummy/lib/assets/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerfectlyNormal/tinymce-rails-imageupload/444da5d06762ea48c15e132c10b871d2d321c713/test/dummy/lib/assets/.keep -------------------------------------------------------------------------------- /test/dummy/lib/tasks/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerfectlyNormal/tinymce-rails-imageupload/444da5d06762ea48c15e132c10b871d2d321c713/test/dummy/lib/tasks/.keep -------------------------------------------------------------------------------- /test/dummy/log/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerfectlyNormal/tinymce-rails-imageupload/444da5d06762ea48c15e132c10b871d2d321c713/test/dummy/log/.keep -------------------------------------------------------------------------------- /test/dummy/public/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The page you were looking for doesn't exist (404) 5 | 48 | 49 | 50 | 51 | 52 |
53 |

The page you were looking for doesn't exist.

54 |

You may have mistyped the address or the page may have moved.

55 |
56 |

If you are the application owner check the logs for more information.

57 | 58 | 59 | -------------------------------------------------------------------------------- /test/dummy/public/422.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The change you wanted was rejected (422) 5 | 48 | 49 | 50 | 51 | 52 |
53 |

The change you wanted was rejected.

54 |

Maybe you tried to change something you didn't have access to.

55 |
56 |

If you are the application owner check the logs for more information.

57 | 58 | 59 | -------------------------------------------------------------------------------- /test/dummy/public/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | We're sorry, but something went wrong (500) 5 | 48 | 49 | 50 | 51 | 52 |
53 |

We're sorry, but something went wrong.

54 |
55 |

If you are the application owner check the logs for more information.

56 | 57 | 58 | -------------------------------------------------------------------------------- /test/dummy/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerfectlyNormal/tinymce-rails-imageupload/444da5d06762ea48c15e132c10b871d2d321c713/test/dummy/public/favicon.ico -------------------------------------------------------------------------------- /test/dummy/public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /test/dummy/test/controllers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerfectlyNormal/tinymce-rails-imageupload/444da5d06762ea48c15e132c10b871d2d321c713/test/dummy/test/controllers/.keep -------------------------------------------------------------------------------- /test/dummy/test/fixtures/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerfectlyNormal/tinymce-rails-imageupload/444da5d06762ea48c15e132c10b871d2d321c713/test/dummy/test/fixtures/.keep -------------------------------------------------------------------------------- /test/dummy/test/helpers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerfectlyNormal/tinymce-rails-imageupload/444da5d06762ea48c15e132c10b871d2d321c713/test/dummy/test/helpers/.keep -------------------------------------------------------------------------------- /test/dummy/test/integration/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerfectlyNormal/tinymce-rails-imageupload/444da5d06762ea48c15e132c10b871d2d321c713/test/dummy/test/integration/.keep -------------------------------------------------------------------------------- /test/dummy/test/mailers/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerfectlyNormal/tinymce-rails-imageupload/444da5d06762ea48c15e132c10b871d2d321c713/test/dummy/test/mailers/.keep -------------------------------------------------------------------------------- /test/dummy/test/models/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerfectlyNormal/tinymce-rails-imageupload/444da5d06762ea48c15e132c10b871d2d321c713/test/dummy/test/models/.keep -------------------------------------------------------------------------------- /test/dummy/test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV["RAILS_ENV"] ||= "test" 2 | require File.expand_path('../../config/environment', __FILE__) 3 | require 'rails/test_help' 4 | 5 | class ActiveSupport::TestCase 6 | ActiveRecord::Migration.check_pending! 7 | 8 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. 9 | # 10 | # Note: You'll currently still have to declare fixtures explicitly in integration tests 11 | # -- they do not yet inherit this setting 12 | fixtures :all 13 | 14 | # Add more helper methods to be used by all tests here... 15 | end 16 | -------------------------------------------------------------------------------- /test/dummy/vendor/assets/javascripts/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerfectlyNormal/tinymce-rails-imageupload/444da5d06762ea48c15e132c10b871d2d321c713/test/dummy/vendor/assets/javascripts/.keep -------------------------------------------------------------------------------- /test/dummy/vendor/assets/stylesheets/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PerfectlyNormal/tinymce-rails-imageupload/444da5d06762ea48c15e132c10b871d2d321c713/test/dummy/vendor/assets/stylesheets/.keep -------------------------------------------------------------------------------- /tinymce-rails-imageupload.gemspec: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | $:.push File.expand_path("../lib", __FILE__) 3 | require "tinymce-rails-imageupload/version" 4 | 5 | Gem::Specification.new do |s| 6 | s.name = "tinymce-rails-imageupload" 7 | s.version = Tinymce::Rails::Imageupload::VERSION 8 | s.authors = ["Per Christian B. Viken"] 9 | s.email = ["perchr@northblue.org"] 10 | s.homepage = "http://eastblue.org/oss" 11 | s.summary = %q{TinyMCE plugin for taking image uploads in Rails >= 3.2} 12 | s.description = %q{TinyMCE plugin for taking image uploads in Rails >= 3.2. Image storage is handled manually, so works with everything.} 13 | 14 | s.files = [Dir["app/assets/javascripts/tinymce/plugins/uploadimage/**/*.js"], 15 | Dir["lib/**/*.rb"], 16 | "lib/tasks/tinymce-uploadimage-assets.rake", 17 | "CHANGELOG.md", 18 | "LICENSE", 19 | "README.md", 20 | ].flatten 21 | s.test_files = [] 22 | s.require_paths = ["lib"] 23 | 24 | s.license = "MIT" 25 | 26 | s.add_runtime_dependency "railties", ">= 3.2" 27 | s.add_runtime_dependency "tinymce-rails", "~> 4.0" 28 | s.add_development_dependency "bundler", "~> 1.0" 29 | s.add_development_dependency "rails", ">= 3.1" 30 | end 31 | --------------------------------------------------------------------------------