rich 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/README.rdoc +163 -0
- data/Rakefile +39 -0
- data/app/assets/images/rich/images.png +0 -0
- data/app/assets/images/rich/plus-red.png +0 -0
- data/app/assets/images/rich/plus.png +0 -0
- data/app/assets/images/rich/x-red.png +0 -0
- data/app/assets/javascripts/rich/application.js +61 -0
- data/app/assets/javascripts/rich/base.js +51 -0
- data/app/assets/javascripts/rich/ckeditor_path.js +1 -0
- data/app/assets/javascripts/rich/uploader.js +59 -0
- data/app/assets/stylesheets/rich/application.css.scss +253 -0
- data/app/assets/stylesheets/rich/editor.css +20 -0
- data/app/assets/stylesheets/rich/files.css +4 -0
- data/app/assets/stylesheets/rich/mixins/reset.css.scss +58 -0
- data/app/controllers/rich/application_controller.rb +11 -0
- data/app/controllers/rich/files_controller.rb +107 -0
- data/app/helpers/rich/application_helper.rb +4 -0
- data/app/helpers/rich/files_helper.rb +4 -0
- data/app/inputs/rich_input.rb +14 -0
- data/app/models/rich/rich_image.rb +77 -0
- data/app/views/layouts/rich/application.html.erb +14 -0
- data/app/views/rich/files/_image.html.erb +9 -0
- data/app/views/rich/files/destroy.js.erb +1 -0
- data/app/views/rich/files/index.html.erb +29 -0
- data/app/views/rich/files/show.html.erb +1 -0
- data/config/routes.rb +5 -0
- data/db/migrate/20111002142937_create_rich_rich_images.rb +17 -0
- data/lib/generators/rich/install/install_generator.rb +34 -0
- data/lib/generators/rich/install/templates/rich.js +1 -0
- data/lib/generators/rich/install/templates/rich.rb.erb +69 -0
- data/lib/rich.rb +63 -0
- data/lib/rich/engine.rb +13 -0
- data/lib/rich/form_builder.rb +14 -0
- data/lib/rich/legacy_formtastic.rb +15 -0
- data/lib/rich/version.rb +3 -0
- data/lib/rich/view_helper.rb +48 -0
- data/lib/tasks/rich_tasks.rake +29 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/admin/dashboards.rb +38 -0
- data/test/dummy/app/admin/posts.rb +11 -0
- data/test/dummy/app/assets/javascripts/active_admin.js +1 -0
- data/test/dummy/app/assets/javascripts/application.js +9 -0
- data/test/dummy/app/assets/javascripts/posts.js +2 -0
- data/test/dummy/app/assets/javascripts/rich.js +1 -0
- data/test/dummy/app/assets/stylesheets/active_admin.css.scss +10 -0
- data/test/dummy/app/assets/stylesheets/application.css +7 -0
- data/test/dummy/app/assets/stylesheets/posts.css +4 -0
- data/test/dummy/app/assets/stylesheets/rich/editor.css +20 -0
- data/test/dummy/app/assets/stylesheets/scaffold.css +56 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/controllers/posts_controller.rb +83 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/helpers/posts_helper.rb +2 -0
- data/test/dummy/app/models/admin_user.rb +9 -0
- data/test/dummy/app/models/post.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/app/views/posts/_form.html.erb +29 -0
- data/test/dummy/app/views/posts/_formtastic_form.html.erb +10 -0
- data/test/dummy/app/views/posts/edit.html.erb +6 -0
- data/test/dummy/app/views/posts/index.html.erb +27 -0
- data/test/dummy/app/views/posts/new.html.erb +5 -0
- data/test/dummy/app/views/posts/show.html.erb +20 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +48 -0
- data/test/dummy/config/boot.rb +19 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +32 -0
- data/test/dummy/config/environments/production.rb +62 -0
- data/test/dummy/config/environments/test.rb +39 -0
- data/test/dummy/config/initializers/active_admin.rb +102 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/devise.rb +211 -0
- data/test/dummy/config/initializers/formtastic.rb +80 -0
- data/test/dummy/config/initializers/inflections.rb +10 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/rich.rb +28 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/devise.en.yml +58 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +13 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/migrate/20111001122048_create_posts.rb +11 -0
- data/test/dummy/db/migrate/20111003150957_create_rich_rich_images.rb +17 -0
- data/test/dummy/db/migrate/20111014123344_devise_create_admin_users.rb +31 -0
- data/test/dummy/db/migrate/20111014143348_create_admin_notes.rb +16 -0
- data/test/dummy/db/migrate/20111014143349_move_admin_notes_to_comments.rb +25 -0
- data/test/dummy/db/production.sqlite3 +0 -0
- data/test/dummy/db/schema.rb +67 -0
- data/test/dummy/log/development.log +72064 -0
- data/test/dummy/log/production.log +2417 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +26 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/public/system/test +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/dummy/test/fixtures/admin_users.yml +11 -0
- data/test/dummy/test/fixtures/posts.yml +11 -0
- data/test/dummy/test/functional/posts_controller_test.rb +49 -0
- data/test/dummy/test/unit/admin_user_test.rb +7 -0
- data/test/dummy/test/unit/helpers/posts_helper_test.rb +4 -0
- data/test/dummy/test/unit/post_test.rb +7 -0
- data/test/dummy/tmp/cache/assets/C2B/5B0/sprockets%2F0c71315129cf9540624929678219ee7b +0 -0
- data/test/dummy/tmp/cache/assets/C32/C40/sprockets%2Ff459d7671964c49e413971720514ba68 +0 -0
- data/test/dummy/tmp/cache/assets/C51/3D0/sprockets%2F110c288a88ab99a1399d35171079612c +0 -0
- data/test/dummy/tmp/cache/assets/C53/630/sprockets%2F0680b1b2c967d3c84970e3786800641c +0 -0
- data/test/dummy/tmp/cache/assets/C53/680/sprockets%2F03d11661470de7443c495783330d9ee7 +0 -0
- data/test/dummy/tmp/cache/assets/C7F/C10/sprockets%2F356f0929a286c961448d76c12a2e14b1 +0 -0
- data/test/dummy/tmp/cache/assets/C8D/E30/sprockets%2F24444bdc865de860f4b693233c973844 +0 -0
- data/test/dummy/tmp/cache/assets/C99/430/sprockets%2F1027b261dc3bd6202585ad4d830263c6 +0 -0
- data/test/dummy/tmp/cache/assets/CAB/440/sprockets%2Fed2218494b3b8488b7268c00e717a0c1 +0 -0
- data/test/dummy/tmp/cache/assets/CB3/920/sprockets%2Fc38c48651c972cee0be83538700535b4 +0 -0
- data/test/dummy/tmp/cache/assets/CB4/740/sprockets%2F36fd3817633b234824bc6577f25ffe01 +0 -0
- data/test/dummy/tmp/cache/assets/CBE/A80/sprockets%2F60bb9087aed9745744925f6ce01525d9 +0 -0
- data/test/dummy/tmp/cache/assets/CC4/040/sprockets%2F83a9f5f7314b761bbd7f1858d1998045 +0 -0
- data/test/dummy/tmp/cache/assets/CC4/590/sprockets%2F869369b5c848f745b23ba174ca9197a6 +0 -0
- data/test/dummy/tmp/cache/assets/CC4/BF0/sprockets%2F93d5b131135a09e48369e02ba5c01b0a +0 -0
- data/test/dummy/tmp/cache/assets/CC7/5F0/sprockets%2F8bf37168fb70e08b9e4578e72739a543 +0 -0
- data/test/dummy/tmp/cache/assets/CD5/340/sprockets%2Fae698307143f445c5011d6ad90b4cf60 +0 -0
- data/test/dummy/tmp/cache/assets/CDD/D50/sprockets%2Faee2002e4369cf20946112efcb776089 +0 -0
- data/test/dummy/tmp/cache/assets/CE4/510/sprockets%2F3271d0cbd86553a56768f4d130ec5e59 +0 -0
- data/test/dummy/tmp/cache/assets/CE8/310/sprockets%2F4ab24984d5862f28160f1f4f067e2ef4 +0 -0
- data/test/dummy/tmp/cache/assets/CEC/1A0/sprockets%2F87fdead6014b961bb870b5931890d677 +0 -0
- data/test/dummy/tmp/cache/assets/CED/2E0/sprockets%2F82382552d084b0569dfd88e34d1cb7e8 +0 -0
- data/test/dummy/tmp/cache/assets/CF0/1D0/sprockets%2F6fc757c2c8329244ca95d6909865bbc2 +0 -0
- data/test/dummy/tmp/cache/assets/CF0/A80/sprockets%2Fd1de761043f6d817880d4b876a73bf87 +0 -0
- data/test/dummy/tmp/cache/assets/CF9/EC0/sprockets%2F04ba1f02c639d30c53eb7b51640b937a +0 -0
- data/test/dummy/tmp/cache/assets/CFB/870/sprockets%2Feb5658a4a2c12e389e4c405f0113a0a7 +0 -0
- data/test/dummy/tmp/cache/assets/D00/7A0/sprockets%2F3ee0dfa5072b54505817cb4bf934201e +0 -0
- data/test/dummy/tmp/cache/assets/D00/C00/sprockets%2F0a61e8d7b11a463083da24605e65d5dd +0 -0
- data/test/dummy/tmp/cache/assets/D07/B30/sprockets%2F0640b99ec5e303921065ac4c0ff8b7f0 +0 -0
- data/test/dummy/tmp/cache/assets/D11/D20/sprockets%2Fcac21eac42152981882bf9e489316af4 +0 -0
- data/test/dummy/tmp/cache/assets/D13/970/sprockets%2F1fd634278255bc58382a590fd5cf24cc +0 -0
- data/test/dummy/tmp/cache/assets/D14/980/sprockets%2F85dc72862eb259cd954ab41369bc6a32 +0 -0
- data/test/dummy/tmp/cache/assets/D15/F40/sprockets%2F83d1a8006e470e79f75592d63bdedc04 +0 -0
- data/test/dummy/tmp/cache/assets/D16/C70/sprockets%2Fd3046a8979c64b4311a728da2ee8b88b +0 -0
- data/test/dummy/tmp/cache/assets/D1D/1A0/sprockets%2Fc2e11e4152a31726c2cbab7333c74ba2 +0 -0
- data/test/dummy/tmp/cache/assets/D1D/500/sprockets%2F71e1de34b5d39e4c637f0fb0619696f7 +0 -0
- data/test/dummy/tmp/cache/assets/D1F/B30/sprockets%2F6351ed750b17ed0f99fa01c32ff98878 +0 -0
- data/test/dummy/tmp/cache/assets/D2A/FA0/sprockets%2Fa5403e1fe15018cddc4435c3cac84910 +0 -0
- data/test/dummy/tmp/cache/assets/D2E/090/sprockets%2Fc54283e81ce52bf9d542ab12492a01ad +0 -0
- data/test/dummy/tmp/cache/assets/D2F/390/sprockets%2Fa02968dd653b0e650fc202c33ff42fc0 +0 -0
- data/test/dummy/tmp/cache/assets/D30/E90/sprockets%2F3a19bbe0320337a6bf29177da71bf1e7 +0 -0
- data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/D34/080/sprockets%2Fe398005214c8d65a54fc19fca2c00c8b +0 -0
- data/test/dummy/tmp/cache/assets/D37/9B0/sprockets%2F0de49dd3031c50c7cf2ef74d6c392530 +0 -0
- data/test/dummy/tmp/cache/assets/D38/540/sprockets%2F86e1ad844bc9df4491a2a52b870421db +0 -0
- data/test/dummy/tmp/cache/assets/D3C/070/sprockets%2F2377eb8a729535e35abd593a6fc00ba6 +0 -0
- data/test/dummy/tmp/cache/assets/D3E/B20/sprockets%2F1f79ee84bd6d74d100c5cb018b662b67 +0 -0
- data/test/dummy/tmp/cache/assets/D40/A40/sprockets%2Feb59c65dcb7136f1cd134dac36794822 +0 -0
- data/test/dummy/tmp/cache/assets/D48/9F0/sprockets%2F6ed3c460867ee6d748edad50818d332a +0 -0
- data/test/dummy/tmp/cache/assets/D4D/650/sprockets%2Ff51d1875ad5829c7bf3ff03e920497be +0 -0
- data/test/dummy/tmp/cache/assets/D52/9B0/sprockets%2F736738bf59f956eb15c4bff06d980be0 +0 -0
- data/test/dummy/tmp/cache/assets/D54/ED0/sprockets%2F71c9fa01091d432b131da3bb73faf3d4 +0 -0
- data/test/dummy/tmp/cache/assets/D55/5C0/sprockets%2F97b52c1c0d1a002ac6fb9d702b7ab625 +0 -0
- data/test/dummy/tmp/cache/assets/D61/940/sprockets%2Fca03651b8f5fb1416c9945cda71ab22d +0 -0
- data/test/dummy/tmp/cache/assets/D6C/F90/sprockets%2Fcb34e531e41b981cf6ca2a5c7e70f890 +0 -0
- data/test/dummy/tmp/cache/assets/D78/9D0/sprockets%2Ff56eced46698105ad2e9d46b1e2ee228 +0 -0
- data/test/dummy/tmp/cache/assets/D84/210/sprockets%2Fabd0103ccec2b428ac62c94e4c40b384 +0 -0
- data/test/dummy/tmp/cache/assets/D86/710/sprockets%2F409dbeb796f68c91b60fe29aef7817e3 +0 -0
- data/test/dummy/tmp/cache/assets/D95/D50/sprockets%2F15e32d81de6597aad23d67d2cd1d0b7a +0 -0
- data/test/dummy/tmp/cache/assets/D96/E90/sprockets%2Ff43f31dd3e2d9f8eda108c01c42bd457 +0 -0
- data/test/dummy/tmp/cache/assets/D98/BF0/sprockets%2F132c8dc4d7ba67c8faee429e5064a02c +0 -0
- data/test/dummy/tmp/cache/assets/D9C/CD0/sprockets%2Fc85016e7bbd4f3adbb7635d01f85d39b +0 -0
- data/test/dummy/tmp/cache/assets/DB9/240/sprockets%2F689d916cf738bdb67e176fced176e3af +0 -0
- data/test/dummy/tmp/cache/assets/DBA/AB0/sprockets%2F8be4208fd77cb5ef9b6f77e5fcf18670 +0 -0
- data/test/dummy/tmp/cache/assets/DC5/450/sprockets%2F82d256faac73d9a3ec5c4f1d11be525d +0 -0
- data/test/dummy/tmp/cache/assets/DC6/890/sprockets%2F41b80fcec0c085408c41ecadc877df0f +0 -0
- data/test/dummy/tmp/cache/assets/DCE/890/sprockets%2Ffd6332ebff4dab12cdf448e195d6b381 +0 -0
- data/test/dummy/tmp/cache/assets/DD7/B50/sprockets%2F7effa89c4b23ab60109f969a9a66ccbc +0 -0
- data/test/dummy/tmp/cache/assets/DDE/420/sprockets%2Ffb8b186d5bf0307f86f65fc787d2adeb +0 -0
- data/test/dummy/tmp/cache/assets/DE7/7C0/sprockets%2F75aa5c034633c20d9c4d1bffbbbdc23d +0 -0
- data/test/dummy/tmp/cache/assets/DF0/680/sprockets%2F5e8210564bdda6fcef1fa19aa04b5e6a +0 -0
- data/test/dummy/tmp/cache/assets/DFB/0C0/sprockets%2Fd35f36529da4a7a4cf67cdbe0a3bf27e +0 -0
- data/test/dummy/tmp/cache/assets/DFF/4D0/sprockets%2F0d7eae306cc4e83ae549e96b1b6da8db +0 -0
- data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/E06/920/sprockets%2F6baa37d1c26468aef4fe5fe4bf982fa3 +0 -0
- data/test/dummy/tmp/cache/assets/E09/680/sprockets%2Fff9edf3a74399a0818b02efcff3ad0f7 +0 -0
- data/test/dummy/tmp/cache/assets/E0B/8B0/sprockets%2F35f64adcaf8786c81c0def5dd2ff47d3 +0 -0
- data/test/dummy/tmp/cache/assets/E2F/E90/sprockets%2Ff4b19e42c92a93dcaaec9fe6eae4081d +0 -0
- data/test/dummy/tmp/cache/sass/12aeefe9aeb071fe3d12ce952e92dfc373eac603/_base.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/12aeefe9aeb071fe3d12ce952e92dfc373eac603/_forms.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/12aeefe9aeb071fe3d12ce952e92dfc373eac603/_header.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/12aeefe9aeb071fe3d12ce952e92dfc373eac603/_mixins.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/12aeefe9aeb071fe3d12ce952e92dfc373eac603/_typography.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/4042a1944de48cf2066ee5650a418db4b1d7f0a1/_base.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/4042a1944de48cf2066ee5650a418db4b1d7f0a1/_forms.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/4042a1944de48cf2066ee5650a418db4b1d7f0a1/_header.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/4042a1944de48cf2066ee5650a418db4b1d7f0a1/_mixins.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/4042a1944de48cf2066ee5650a418db4b1d7f0a1/_typography.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/4905b1148d31ac1351d8ccf185fbd2494a596795/application.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/4f667cf792197ab0525ceee5448b803db81dab90/_comments.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/4f667cf792197ab0525ceee5448b803db81dab90/_date_picker.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/4f667cf792197ab0525ceee5448b803db81dab90/_flash_messages.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/4f667cf792197ab0525ceee5448b803db81dab90/_tables.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/76bbe61bc8118aa78e4db81878cf11d79a964373/_all.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/76bbe61bc8118aa78e4db81878cf11d79a964373/_buttons.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/76bbe61bc8118aa78e4db81878cf11d79a964373/_gradients.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/76bbe61bc8118aa78e4db81878cf11d79a964373/_icons.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/76bbe61bc8118aa78e4db81878cf11d79a964373/_reset.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/76bbe61bc8118aa78e4db81878cf11d79a964373/_rounded.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/76bbe61bc8118aa78e4db81878cf11d79a964373/_sections.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/76bbe61bc8118aa78e4db81878cf11d79a964373/_shadows.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/76bbe61bc8118aa78e4db81878cf11d79a964373/_utilities.scssc +0 -0
- data/test/dummy/tmp/cache/sass/76bbe61bc8118aa78e4db81878cf11d79a964373/_variables.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/9b29130c260e464c0ad2c23c77a58da7c3f9eec7/active_admin.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/dc62b2f303532e1c32e9571414568d9c2570f335/_all.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/dc62b2f303532e1c32e9571414568d9c2570f335/_buttons.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/dc62b2f303532e1c32e9571414568d9c2570f335/_gradients.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/dc62b2f303532e1c32e9571414568d9c2570f335/_icons.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/dc62b2f303532e1c32e9571414568d9c2570f335/_reset.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/dc62b2f303532e1c32e9571414568d9c2570f335/_rounded.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/dc62b2f303532e1c32e9571414568d9c2570f335/_sections.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/dc62b2f303532e1c32e9571414568d9c2570f335/_shadows.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/dc62b2f303532e1c32e9571414568d9c2570f335/_utilities.scssc +0 -0
- data/test/dummy/tmp/cache/sass/dc62b2f303532e1c32e9571414568d9c2570f335/_variables.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/ddba83cb438190ca32bf384b6eea0c3ef82ae9fa/reset.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/dde0527ffef9ea409c8e8afb2306d11f2e0b6500/_comments.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/dde0527ffef9ea409c8e8afb2306d11f2e0b6500/_date_picker.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/dde0527ffef9ea409c8e8afb2306d11f2e0b6500/_flash_messages.css.scssc +0 -0
- data/test/dummy/tmp/cache/sass/dde0527ffef9ea409c8e8afb2306d11f2e0b6500/_tables.css.scssc +0 -0
- data/test/fixtures/rich/rich_images.yml +11 -0
- data/test/functional/rich/files_controller_test.rb +9 -0
- data/test/integration/navigation_test.rb +10 -0
- data/test/rich_test.rb +7 -0
- data/test/test_helper.rb +10 -0
- data/test/unit/helpers/rich/files_helper_test.rb +6 -0
- data/test/unit/rich/rich_image_test.rb +9 -0
- metadata +603 -0
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2011 YOURNAME
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,163 @@
|
|
1
|
+
= Rich
|
2
|
+
|
3
|
+
Rich is an opinionated implementation of CKEditor for Rails 3.1. It includes a stripped down toolbar, simplified dialogs and a custom file manager.
|
4
|
+
|
5
|
+
Presently, Rich integrates with Formtastic (1.x and 2) and regular Rails forms.
|
6
|
+
|
7
|
+
== Goals
|
8
|
+
|
9
|
+
1. Keep the CKEditor source our of your project.
|
10
|
+
2. Sensible defaults. We don't want our users to insert tables, smilies or other frivolities that will do nothing but ruin a lovingly crafted design.
|
11
|
+
3. Make it easy to customize these defaults.
|
12
|
+
4. Implement a usable (and easily configurable) file manager that serves up images that fit your specific design.
|
13
|
+
5. A good upload experience, but no flash.
|
14
|
+
|
15
|
+
It should be noted that while a major point of this project was to remove many things from CKEditor, all that stuff is still in there and can be easily re-enabled through the initializer.
|
16
|
+
|
17
|
+
== Quick install
|
18
|
+
|
19
|
+
Rich is available as a Ruby Gem, which makes installation very easy.
|
20
|
+
|
21
|
+
# In your Gemfile (Rails >= 3.1)
|
22
|
+
gem 'rich', :git => 'https://github.com/bastiaanterhorst/rich.git'
|
23
|
+
|
24
|
+
After updating your bundle, run the installer.
|
25
|
+
|
26
|
+
$> rails generate rich:install
|
27
|
+
|
28
|
+
The installer sets up a route, creates an initializer for configuration and adds a javascript and CSS file. It also creates a migration, so we need to migrate the database.
|
29
|
+
|
30
|
+
$> rake db:migrate
|
31
|
+
|
32
|
+
As a last step, secure the file manager by setting your authentication method in <tt>/config/initializers/rich.rb</tt>. If you're using Devise with an AdminUser model (incidentally, the Active Admin defaults):
|
33
|
+
config.authentication_method = :authenticate_admin_user!
|
34
|
+
|
35
|
+
You're good to go.
|
36
|
+
|
37
|
+
== Usage
|
38
|
+
|
39
|
+
To use Rich, it's javascript file must be loaded. By default, this is already setup for you because Rails loads all Javascript files through the <tt>require_tree .</tt> command in application.js. If you've removed that line, manually load rich by requiring it.
|
40
|
+
|
41
|
+
//= require rich
|
42
|
+
|
43
|
+
=== In a Rails form
|
44
|
+
|
45
|
+
Use the <tt>rich_text_area</tt> command to insert Rich.
|
46
|
+
|
47
|
+
<%= form_for(@post) do |f| %>
|
48
|
+
<div class="field">
|
49
|
+
<%= f.label :name %><br />
|
50
|
+
<%= f.text_field :name %>
|
51
|
+
</div>
|
52
|
+
<div class="field">
|
53
|
+
<%= f.label :title %><br />
|
54
|
+
<%= f.text_field :title %>
|
55
|
+
</div>
|
56
|
+
<div class="field">
|
57
|
+
<%= f.label :content %><br />
|
58
|
+
<%= f.rich_text_area :body %>
|
59
|
+
</div>
|
60
|
+
<div class="actions">
|
61
|
+
<%= f.submit %>
|
62
|
+
</div>
|
63
|
+
<% end %>
|
64
|
+
|
65
|
+
=== Formtastic
|
66
|
+
|
67
|
+
Use <tt>:as => :rich</tt> to insert Rich. Using it is very simple, like so:
|
68
|
+
|
69
|
+
<%= semantic_form_for @post do |f| %>
|
70
|
+
<%= f.inputs do %>
|
71
|
+
<%= f.input :name %>
|
72
|
+
<%= f.input :title %>
|
73
|
+
<%= f.input :body, :as => :rich %>
|
74
|
+
<% end %>
|
75
|
+
<%= f.buttons do %>
|
76
|
+
<%= f.commit_button %>
|
77
|
+
<% end %>
|
78
|
+
<% end %>
|
79
|
+
|
80
|
+
=== Active Admin
|
81
|
+
|
82
|
+
Since Active Admin actually uses Formtastic, you can use it with Rich out of the box. In your model configuration file, set up your form like this.
|
83
|
+
|
84
|
+
form do |f|
|
85
|
+
f.inputs "Basic info" do
|
86
|
+
f.input :title
|
87
|
+
f.input :body, :as => :rich
|
88
|
+
end
|
89
|
+
f.buttons
|
90
|
+
end
|
91
|
+
|
92
|
+
If you're annoyed by the fact that the Rich editor overlaps the field label (I was!), add the following to your <tt>/app/assets/stylesheets/active_admin.css.scss</tt>.
|
93
|
+
|
94
|
+
.cke_skin_kama {
|
95
|
+
margin-left: 20%;
|
96
|
+
}
|
97
|
+
|
98
|
+
== Screenshots
|
99
|
+
|
100
|
+
This is the editor with default settings.
|
101
|
+
{<img src="https://github.com/bastiaanterhorst/rich/raw/master/screenshots/rich-editor-default.png" />}[https://github.com/bastiaanterhorst/rich/]
|
102
|
+
|
103
|
+
This is the file manager.
|
104
|
+
{<img src="https://github.com/bastiaanterhorst/rich/raw/master/screenshots/rich-filemanager.png" />}[https://github.com/bastiaanterhorst/rich/]
|
105
|
+
|
106
|
+
== Rich in production mode
|
107
|
+
|
108
|
+
Rich works fine in production mode, as long as you make sure to precompile your assets. Rich extends the <tt>assets:precompile</tt> task to make sure the full CKEditor source tree is copied to your assets folder. So make sure you precompile your assets before starting production mode (something you most likely are doing anyway).
|
109
|
+
|
110
|
+
rake assets:precompile
|
111
|
+
|
112
|
+
Rich will also clean up these CKEditor files when you clean your assets. So the following works as expected.
|
113
|
+
|
114
|
+
rake assets:clean
|
115
|
+
|
116
|
+
Although generally not necessary, the underlying Rich tasks can be invoked directly.
|
117
|
+
|
118
|
+
rake rich:assetize_ckeditor
|
119
|
+
rake rich:clean_ckeditor
|
120
|
+
|
121
|
+
== Configuration and overrides
|
122
|
+
|
123
|
+
Take a look at the generated <tt>rich.rb</tt> initializer and – if you want to dig deeper – the Rich sourcecode. The initializer guides you through the most important settings and configuration options.
|
124
|
+
|
125
|
+
=== CKEditor configuration
|
126
|
+
|
127
|
+
Rich attempts to provide you with a sensible set of buttons and capabilities. But of course, you might disagree. To that end, you can configure CKEditor through the <tt>editor</tt> directive, either globally through the initializer, or per editor instance as an option.
|
128
|
+
|
129
|
+
=== Editor styles
|
130
|
+
|
131
|
+
When you run the generator a css file is created for you in <tt>app/assets/stylesheets/rich/editor.css</tt>. Use this stylesheet to define the contents of the Styles drop down in CKEditor.
|
132
|
+
|
133
|
+
=== Image configuration
|
134
|
+
|
135
|
+
The styles you define in the initializer are passed to Paperclip directly, so the syntax is identical. See https://github.com/thoughtbot/paperclip/wiki/Thumbnail-Generation for more information.
|
136
|
+
|
137
|
+
Currently the image styles available in the file manager can only be set globally in the initializer.
|
138
|
+
|
139
|
+
== Planned features
|
140
|
+
|
141
|
+
* Scoping assets to other objects
|
142
|
+
* per-editor-instance image styles
|
143
|
+
* Drag & drop uploading
|
144
|
+
* separate form control to select/upload images without CKEditor
|
145
|
+
* localization support
|
146
|
+
|
147
|
+
== Inspiration
|
148
|
+
|
149
|
+
* Igor Galeta's ckeditor gem - https://github.com/galetahub/ckeditor
|
150
|
+
* Francesc Esplugas' Ckeditor - https://github.com/fesplugas/rails-ckeditor
|
151
|
+
* Gregg Bell's Active Admin - https://github.com/gregbell/active_admin
|
152
|
+
|
153
|
+
== Tools used
|
154
|
+
|
155
|
+
* Valum's FileUploader - https://github.com/valums/file-uploader
|
156
|
+
* Rack Raw Upload - https://github.com/newbamboo/rack-raw-upload
|
157
|
+
* Paperclip - https://github.com/thoughtbot/paperclip
|
158
|
+
|
159
|
+
== Copyright
|
160
|
+
|
161
|
+
Rich was created by Bastiaan Terhorst and is sponsored by Perceptor (http://perceptor.nl).
|
162
|
+
|
163
|
+
This project is licenced under the MIT License. See MIT-LICENSE for details.
|
data/Rakefile
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
begin
|
3
|
+
require 'bundler/setup'
|
4
|
+
rescue LoadError
|
5
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
6
|
+
end
|
7
|
+
begin
|
8
|
+
require 'rdoc/task'
|
9
|
+
rescue LoadError
|
10
|
+
require 'rdoc/rdoc'
|
11
|
+
require 'rake/rdoctask'
|
12
|
+
RDoc::Task = Rake::RDocTask
|
13
|
+
end
|
14
|
+
|
15
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
16
|
+
rdoc.rdoc_dir = 'rdoc'
|
17
|
+
rdoc.title = 'Rich'
|
18
|
+
rdoc.options << '--line-numbers'
|
19
|
+
rdoc.rdoc_files.include('README.rdoc')
|
20
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
21
|
+
end
|
22
|
+
|
23
|
+
APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
|
24
|
+
load 'rails/tasks/engine.rake'
|
25
|
+
|
26
|
+
|
27
|
+
Bundler::GemHelper.install_tasks
|
28
|
+
|
29
|
+
require 'rake/testtask'
|
30
|
+
|
31
|
+
Rake::TestTask.new(:test) do |t|
|
32
|
+
t.libs << 'lib'
|
33
|
+
t.libs << 'test'
|
34
|
+
t.pattern = 'test/**/*_test.rb'
|
35
|
+
t.verbose = false
|
36
|
+
end
|
37
|
+
|
38
|
+
|
39
|
+
task :default => :test
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,61 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into including all the files listed below.
|
2
|
+
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
|
3
|
+
// be included in the compiled file accessible from http://example.com/assets/application.js
|
4
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
5
|
+
// the compiled file.
|
6
|
+
//
|
7
|
+
//= require jquery
|
8
|
+
//= require jquery_ujs
|
9
|
+
//= require fileuploader
|
10
|
+
//= require rich/uploader
|
11
|
+
|
12
|
+
var rich_current_style = "";
|
13
|
+
function selectStyle(name) {
|
14
|
+
rich_current_style = name;
|
15
|
+
$('#styles li').removeClass('selected');
|
16
|
+
$('#style-'+name).addClass('selected');
|
17
|
+
}
|
18
|
+
|
19
|
+
|
20
|
+
(function($) {
|
21
|
+
$.QueryString = (function(a) {
|
22
|
+
if (a == "") return {};
|
23
|
+
var b = {};
|
24
|
+
for (var i = 0; i < a.length; ++i)
|
25
|
+
{
|
26
|
+
var p=a[i].split('=');
|
27
|
+
if (p.length != 2) continue;
|
28
|
+
b[p[0]] = decodeURIComponent(p[1].replace(/\+/g, " "));
|
29
|
+
}
|
30
|
+
return b;
|
31
|
+
})(window.location.search.substr(1).split('&'))
|
32
|
+
})(jQuery);
|
33
|
+
|
34
|
+
$(function() {
|
35
|
+
|
36
|
+
// click an image to insert it in the editor
|
37
|
+
$('#images li img').live('click', function(e){
|
38
|
+
//var url = $(this).data('url');
|
39
|
+
// var url = $(this).attr('src');
|
40
|
+
var url = $(this).data('uris')[rich_current_style];
|
41
|
+
var id = $(this).data('rich-image-id');
|
42
|
+
|
43
|
+
window.opener.CKEDITOR.tools.callFunction($.QueryString["CKEditorFuncNum"], url, id);
|
44
|
+
window.setTimeout(function(){
|
45
|
+
window.close();
|
46
|
+
},500);
|
47
|
+
});
|
48
|
+
|
49
|
+
$('#styles li').click(function(e){
|
50
|
+
selectStyle($(this).data('rich-style'));
|
51
|
+
});
|
52
|
+
|
53
|
+
// preselect the default style
|
54
|
+
selectStyle($('#styles').data('default-style'));
|
55
|
+
|
56
|
+
// fancy uploading
|
57
|
+
new rich.Uploader();
|
58
|
+
|
59
|
+
});
|
60
|
+
|
61
|
+
|
@@ -0,0 +1,51 @@
|
|
1
|
+
// Wire up Rich
|
2
|
+
//= require rich/ckeditor_path
|
3
|
+
//= require ckeditor/ckeditor
|
4
|
+
//= require ckeditor/adapters/jquery
|
5
|
+
|
6
|
+
function addQueryString( url, params ) {
|
7
|
+
var queryString = [];
|
8
|
+
if (!params) return url;
|
9
|
+
else {
|
10
|
+
for (var i in params) queryString.push(i + "=" + encodeURIComponent( params[i]));
|
11
|
+
}
|
12
|
+
return url + ( ( url.indexOf( "?" ) != -1 ) ? "&" : "?" ) + queryString.join( "&" );
|
13
|
+
}
|
14
|
+
|
15
|
+
// implement a basic plugin to insert rich images
|
16
|
+
|
17
|
+
// accepted properties:
|
18
|
+
// richImageUrl - path to image browser action
|
19
|
+
// richImageAllowedStyles - list of allowed image styles, defaults to all
|
20
|
+
// richImageOwnerType
|
21
|
+
// richImageOwnerId
|
22
|
+
|
23
|
+
CKEDITOR.plugins.add('richimage',
|
24
|
+
{
|
25
|
+
init: function(editor) {
|
26
|
+
|
27
|
+
// register a callback that actually inserts a selected image
|
28
|
+
editor._.insertImagefn = CKEDITOR.tools.addFunction(function(url, id){
|
29
|
+
this.insertHtml('<img src="' + url + '" alt="" data-rich-image-id="' + id + '" />');
|
30
|
+
}, editor );
|
31
|
+
|
32
|
+
// clean up the callback
|
33
|
+
editor.on( 'destroy', function () { CKEDITOR.tools.removeFunction( this._.insertImagefn ); } );
|
34
|
+
|
35
|
+
editor.addCommand( 'insertRichImage', {
|
36
|
+
exec: function(editor) {
|
37
|
+
var params = {};
|
38
|
+
params.CKEditor = editor.name;
|
39
|
+
params.CKEditorFuncNum = editor._.insertImagefn;
|
40
|
+
var url = addQueryString(editor.config.richImageUrl, params );
|
41
|
+
editor.popup(url, 860, 400);
|
42
|
+
}
|
43
|
+
});
|
44
|
+
|
45
|
+
editor.ui.addButton( 'richImage', {
|
46
|
+
label : editor.lang.common.image,
|
47
|
+
command: 'insertRichImage',
|
48
|
+
icon: '/assets/rich/images.png'
|
49
|
+
});
|
50
|
+
}
|
51
|
+
});
|
@@ -0,0 +1 @@
|
|
1
|
+
var CKEDITOR_BASEPATH = '/assets/ckeditor/';
|
@@ -0,0 +1,59 @@
|
|
1
|
+
// Implementation of the QQ FileUploader class for use in Rich
|
2
|
+
|
3
|
+
var rich = rich || {};
|
4
|
+
|
5
|
+
rich.Uploader = function(){
|
6
|
+
|
7
|
+
this._options = {
|
8
|
+
uploadButtonId: 'upload',
|
9
|
+
insertionPoint: 'uploadBlock'
|
10
|
+
};
|
11
|
+
|
12
|
+
// create the qq uploader
|
13
|
+
var self = this;
|
14
|
+
var uploader = new qq.FileUploaderBasic({
|
15
|
+
button: document.getElementById(self._options.uploadButtonId),
|
16
|
+
multiple: true,
|
17
|
+
maxConnections: 3,
|
18
|
+
action: $("#new_rich_rich_image").attr("action"),
|
19
|
+
params: { authenticity_token: $("input[name='authenticity_token']").attr("value") },
|
20
|
+
debug: true,
|
21
|
+
onComplete: function(id, fileName, responseJSON) { self.uploadComplete(id, fileName, responseJSON); },
|
22
|
+
onSubmit: function(id, fileName) { self.uploadSubmit(id, fileName); },
|
23
|
+
onProgress: function(id, fileName, loaded, total) { self.uploadProgress(id, fileName, Math.round(loaded/total*100)); }
|
24
|
+
});
|
25
|
+
};
|
26
|
+
|
27
|
+
rich.Uploader.prototype = {
|
28
|
+
|
29
|
+
uploadComplete: function(id, fileName, response){
|
30
|
+
if (response.success){
|
31
|
+
$('#up'+id+' .progress-bar').first().width("100%");
|
32
|
+
$('#up'+id+' .spinner').first().addClass("spinning");
|
33
|
+
//get the created image object's id from the response and use it to request the thumbnail
|
34
|
+
$.get("/rich/files/"+response.rich_id, function(data) {
|
35
|
+
$('#up'+id).replaceWith(data).addClass("test");
|
36
|
+
$('#image'+response.rich_id).addClass("new");
|
37
|
+
});
|
38
|
+
} else {
|
39
|
+
$('#up'+id+' .spinner').first().addClass("error");
|
40
|
+
$('#up'+id+' .spinner').first().removeClass("spinning");
|
41
|
+
}
|
42
|
+
},
|
43
|
+
|
44
|
+
uploadSubmit: function(id, fileName) {
|
45
|
+
console.log($('#'+this._options.insertionPoint));
|
46
|
+
// insert a new image placeholder after the upload button
|
47
|
+
$('#'+this._options.insertionPoint).after('<li id="up'+id+'"><div class="placeholder progress"><div class="progress-bar" style="width: 0%;"></div><div class="spinner"></div></div><p>'+fileName+'</p></li>');
|
48
|
+
},
|
49
|
+
|
50
|
+
uploadProgress: function(id, fileName, progress) {
|
51
|
+
$('#up'+id+' .progress-bar').first().width(progress+"%");
|
52
|
+
|
53
|
+
if(progress > 90) {
|
54
|
+
// start spinning
|
55
|
+
$('#up'+id+' .spinner').first().addClass("spinning");
|
56
|
+
}
|
57
|
+
},
|
58
|
+
|
59
|
+
};
|
@@ -0,0 +1,253 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll automatically include all the stylesheets available in this directory
|
3
|
+
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
|
4
|
+
* the top of the compiled file, but it's generally better to create a new file per style scope.
|
5
|
+
*= require_self
|
6
|
+
*= require_tree ./mixins
|
7
|
+
*/
|
8
|
+
|
9
|
+
|
10
|
+
// main vars
|
11
|
+
$activeText: #3bbfce;
|
12
|
+
$normalText: #3bbfce;
|
13
|
+
$dimmedText: #3bbfce;
|
14
|
+
|
15
|
+
$subtle: #f3f3f3;
|
16
|
+
$light: #888888;
|
17
|
+
$dark: #686868;
|
18
|
+
|
19
|
+
|
20
|
+
$imageSize: 100px;
|
21
|
+
$margin: 20px;
|
22
|
+
$headerHeight: 46px;
|
23
|
+
$verticalCenterOffset: 5px;
|
24
|
+
|
25
|
+
$fontSizeSmall: 10px;
|
26
|
+
$fontSizeNormal: 12px;
|
27
|
+
$fontSizeLarge: 16px;
|
28
|
+
|
29
|
+
|
30
|
+
// Mixins
|
31
|
+
@mixin rounded($radius: 4px) {
|
32
|
+
-webkit-border-radius: $radius;
|
33
|
+
-moz-border-radius: $radius;
|
34
|
+
border-radius: $radius;
|
35
|
+
}
|
36
|
+
|
37
|
+
@mixin inset-box-shadow($x: 2px, $y: 2px, $blur: 4px, $color: blue) {
|
38
|
+
box-shadow: inset $x $y $blur $color;
|
39
|
+
-moz-box-shadow: inset $x $y $blur $color;
|
40
|
+
-webkit-box-shadow: inset $x $y $blur $color;
|
41
|
+
}
|
42
|
+
|
43
|
+
@mixin box-shadow($x: 2px, $y: 2px, $blur: 4px, $color: blue) {
|
44
|
+
box-shadow: $x $y $blur $color;
|
45
|
+
-moz-box-shadow: set $x $y $blur $color;
|
46
|
+
-webkit-box-shadow: $x $y $blur $color;
|
47
|
+
}
|
48
|
+
|
49
|
+
@-webkit-keyframes spinner {
|
50
|
+
from {-webkit-transform:rotate(0deg);}
|
51
|
+
to {-webkit-transform:rotate(360deg);}
|
52
|
+
}
|
53
|
+
|
54
|
+
|
55
|
+
// the meat
|
56
|
+
*, html, body {
|
57
|
+
font-family: helvetica, arial, sans-serif;
|
58
|
+
-webkit-font-smoothing: antialiased;
|
59
|
+
|
60
|
+
-webkit-user-select: none;
|
61
|
+
-khtml-user-select: none;
|
62
|
+
-moz-user-select: none;
|
63
|
+
-o-user-select: none;
|
64
|
+
user-select: none;
|
65
|
+
}
|
66
|
+
|
67
|
+
#legacy-form {
|
68
|
+
display: none;
|
69
|
+
}
|
70
|
+
|
71
|
+
header {
|
72
|
+
position: fixed;
|
73
|
+
z-index: 999;
|
74
|
+
height: $headerHeight;
|
75
|
+
width: 100%;
|
76
|
+
|
77
|
+
background: $subtle;
|
78
|
+
border-bottom: 1px solid white;
|
79
|
+
|
80
|
+
@include box-shadow(0, 0, 4px, rgba(0,0,0,0.5))
|
81
|
+
}
|
82
|
+
|
83
|
+
#images {
|
84
|
+
list-style: none;
|
85
|
+
margin: 0 0 0 $margin;
|
86
|
+
padding: 0;
|
87
|
+
padding-top: $headerHeight + $margin + 1;
|
88
|
+
|
89
|
+
li {
|
90
|
+
width: $imageSize;
|
91
|
+
height: $imageSize + $margin;
|
92
|
+
margin-right: $margin;
|
93
|
+
float: left;
|
94
|
+
|
95
|
+
* {
|
96
|
+
transition: opacity 85ms ease-in, box-shadow 85ms ease-in, color 85ms ease-in;
|
97
|
+
-moz-transition: opacity 85ms ease-in, box-shadow 85ms ease-in, color 85ms ease-in;
|
98
|
+
-ms-transition: opacity 85ms ease-in, box-shadow 85ms ease-in, color 85ms ease-in;
|
99
|
+
-webkit-transition: opacity 85ms ease-in, box-shadow 85ms ease-in, color 85ms ease-in;
|
100
|
+
}
|
101
|
+
|
102
|
+
.placeholder {
|
103
|
+
height: $imageSize - 2;
|
104
|
+
width: $imageSize - 2;
|
105
|
+
border: 1px dotted $light;
|
106
|
+
@include rounded;
|
107
|
+
line-height: $imageSize - $verticalCenterOffset;
|
108
|
+
text-align: center;
|
109
|
+
|
110
|
+
font-size: $fontSizeLarge;
|
111
|
+
font-weight: bold;
|
112
|
+
color: $light;
|
113
|
+
}
|
114
|
+
|
115
|
+
img {
|
116
|
+
@include rounded;
|
117
|
+
@include box-shadow(0, 0, 4px, lighten($dark, 40%));
|
118
|
+
}
|
119
|
+
|
120
|
+
img:hover {
|
121
|
+
@include box-shadow(0, 0, 4px, $light);
|
122
|
+
}
|
123
|
+
|
124
|
+
img:active {
|
125
|
+
@include box-shadow(0, 0, 4px, black);
|
126
|
+
}
|
127
|
+
|
128
|
+
.new {
|
129
|
+
@include box-shadow(0, 0, 4px, rgb(58,194,207))
|
130
|
+
}
|
131
|
+
|
132
|
+
.spinner {
|
133
|
+
opacity: 0.3;
|
134
|
+
margin-left: ($imageSize - 2)/2 - 32/2;
|
135
|
+
margin-top: ($imageSize - 2 - $verticalCenterOffset)/2 - 32/2;
|
136
|
+
width: 32px;
|
137
|
+
height: 32px;
|
138
|
+
background: image-url('rich/plus.png') no-repeat top center;
|
139
|
+
}
|
140
|
+
|
141
|
+
#upload .spinner {
|
142
|
+
opacity: 1;
|
143
|
+
}
|
144
|
+
|
145
|
+
.progress .progress-bar {
|
146
|
+
background: $subtle;
|
147
|
+
height: $imageSize - 2;
|
148
|
+
float: left;
|
149
|
+
}
|
150
|
+
|
151
|
+
.progress .spinning {
|
152
|
+
-webkit-animation-name: spinner;
|
153
|
+
-webkit-animation-duration:0.75s;
|
154
|
+
-webkit-animation-iteration-count:infinite;
|
155
|
+
-webkit-animation-timing-function:linear;
|
156
|
+
}
|
157
|
+
|
158
|
+
.progress .spinner.error {
|
159
|
+
opacity: 1;
|
160
|
+
background-image: image-url('rich/plus-red.png');
|
161
|
+
-webkit-transform: rotate(45deg);
|
162
|
+
}
|
163
|
+
|
164
|
+
p {
|
165
|
+
font-size: 10px;
|
166
|
+
margin: 0;
|
167
|
+
line-height: $margin;
|
168
|
+
height: $margin;
|
169
|
+
overflow:hidden;
|
170
|
+
text-overflow: ellipsis;
|
171
|
+
color: $subtle;
|
172
|
+
width: 80px;
|
173
|
+
}
|
174
|
+
|
175
|
+
&:hover p {
|
176
|
+
color: $light;
|
177
|
+
}
|
178
|
+
|
179
|
+
.delete {
|
180
|
+
position: absolute;
|
181
|
+
text-indent: -9999px;
|
182
|
+
margin-left: 80px;
|
183
|
+
margin-top: -$margin;
|
184
|
+
width:$margin;
|
185
|
+
height: $margin;
|
186
|
+
background: image-url('rich/x-red.png') no-repeat center right;
|
187
|
+
opacity: 0.1;
|
188
|
+
}
|
189
|
+
|
190
|
+
&:hover .delete {
|
191
|
+
opacity: 0.5;
|
192
|
+
}
|
193
|
+
|
194
|
+
&:hover .delete:hover {
|
195
|
+
opacity: 1;
|
196
|
+
}
|
197
|
+
|
198
|
+
}
|
199
|
+
|
200
|
+
#uploadBlock:hover .placeholder .spinner {
|
201
|
+
background-position: 0 -32px;
|
202
|
+
}
|
203
|
+
|
204
|
+
|
205
|
+
}
|
206
|
+
|
207
|
+
.clickable:hover {
|
208
|
+
cursor: pointer;
|
209
|
+
}
|
210
|
+
|
211
|
+
// scope selector
|
212
|
+
ul.scopes {
|
213
|
+
|
214
|
+
list-style: none;
|
215
|
+
margin: 0 ($margin/4*3);
|
216
|
+
padding: 0;
|
217
|
+
float: right;
|
218
|
+
|
219
|
+
li {
|
220
|
+
float: left;
|
221
|
+
height: $margin;
|
222
|
+
line-height: $margin;
|
223
|
+
margin-right: $margin/4;
|
224
|
+
margin-top: ($headerHeight - $margin) / 2 + 1;
|
225
|
+
font-weight: bold;
|
226
|
+
font-size: 12px;
|
227
|
+
}
|
228
|
+
|
229
|
+
li.label {
|
230
|
+
color: $light;
|
231
|
+
padding-right: $margin/4;
|
232
|
+
}
|
233
|
+
|
234
|
+
li.scope {
|
235
|
+
color: $dark;
|
236
|
+
@include rounded;
|
237
|
+
padding: 0 $margin / 2;
|
238
|
+
}
|
239
|
+
|
240
|
+
li.scope:hover {
|
241
|
+
cursor: pointer;
|
242
|
+
background: darken($subtle, 10%);
|
243
|
+
text-shadow: 0px 1px 0 white;
|
244
|
+
}
|
245
|
+
|
246
|
+
li.scope.selected {
|
247
|
+
@include inset-box-shadow(0, 1px, 1px, $dark);
|
248
|
+
text-shadow: 0px 1px 0 rgba(0, 0, 0, 0.25);
|
249
|
+
color: $subtle;
|
250
|
+
background: $light;
|
251
|
+
}
|
252
|
+
|
253
|
+
}
|