virgo 0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/Rakefile +37 -0
- data/app/assets/javascripts/tinymce/manifest.coffee +1 -0
- data/app/assets/javascripts/tinymce/plugins/image_manager/plugin.coffee +234 -0
- data/app/assets/javascripts/virgo/admin/page_modules/edit_form.coffee +4 -0
- data/app/assets/javascripts/virgo/admin/page_modules/edit_subject_form.coffee +29 -0
- data/app/assets/javascripts/virgo/admin/posts/edit_locking.coffee +35 -0
- data/app/assets/javascripts/virgo/admin/posts/form.coffee +183 -0
- data/app/assets/javascripts/virgo/admin/slides/form.coffee +27 -0
- data/app/assets/javascripts/virgo/admin/slideshows/form.coffee +26 -0
- data/app/assets/javascripts/virgo/admin_only.coffee +1 -0
- data/app/assets/javascripts/virgo/application.coffee +51 -0
- data/app/assets/javascripts/virgo/common.coffee +83 -0
- data/app/assets/javascripts/virgo/common/character_counter.coffee +27 -0
- data/app/assets/javascripts/virgo/components/header.coffee +47 -0
- data/app/assets/javascripts/virgo/components/media_modal.coffee +151 -0
- data/app/assets/javascripts/virgo/components/share_bar.coffee +53 -0
- data/app/assets/javascripts/virgo/components/slideshow.coffee +35 -0
- data/app/assets/javascripts/virgo/lib/jquery-ui-multiselect.js +342 -0
- data/app/assets/javascripts/virgo/lib/jquery.browser.js +184 -0
- data/app/assets/javascripts/virgo/lib/jquery.cookie.js +114 -0
- data/app/assets/javascripts/virgo/lib/jquery.pjax.js +932 -0
- data/app/assets/javascripts/virgo/lib/jquery_ext.coffee +0 -0
- data/app/assets/javascripts/virgo/lib/manifest.coffee +5 -0
- data/app/assets/javascripts/virgo/lib/ouibounce.js +194 -0
- data/app/assets/javascripts/virgo/page_modules.coffee +175 -0
- data/app/assets/javascripts/virgo/posts/show.coffee +32 -0
- data/app/assets/stylesheets/tinymce/skin.sass +2 -0
- data/app/assets/stylesheets/tinymce/skins/railspress/content.min.sass +82 -0
- data/app/assets/stylesheets/tinymce/skins/railspress/fonts/tinymce-small.eot +0 -0
- data/app/assets/stylesheets/tinymce/skins/railspress/fonts/tinymce-small.svg +62 -0
- data/app/assets/stylesheets/tinymce/skins/railspress/fonts/tinymce-small.ttf +0 -0
- data/app/assets/stylesheets/tinymce/skins/railspress/fonts/tinymce-small.woff +0 -0
- data/app/assets/stylesheets/tinymce/skins/railspress/fonts/tinymce.eot +0 -0
- data/app/assets/stylesheets/tinymce/skins/railspress/fonts/tinymce.svg +63 -0
- data/app/assets/stylesheets/tinymce/skins/railspress/fonts/tinymce.ttf +0 -0
- data/app/assets/stylesheets/tinymce/skins/railspress/fonts/tinymce.woff +0 -0
- data/app/assets/stylesheets/tinymce/skins/railspress/img/anchor.gif +0 -0
- data/app/assets/stylesheets/tinymce/skins/railspress/img/loader.gif +0 -0
- data/app/assets/stylesheets/tinymce/skins/railspress/img/object.gif +0 -0
- data/app/assets/stylesheets/tinymce/skins/railspress/img/trans.gif +0 -0
- data/app/assets/stylesheets/tinymce/skins/railspress/skin.min.sass +1703 -0
- data/app/assets/stylesheets/virgo/_common.sass +65 -0
- data/app/assets/stylesheets/virgo/admin.sass +301 -0
- data/app/assets/stylesheets/virgo/admin/columns.sass +3 -0
- data/app/assets/stylesheets/virgo/admin/images.sass +14 -0
- data/app/assets/stylesheets/virgo/admin/media_modal.sass +72 -0
- data/app/assets/stylesheets/virgo/admin/post.sass +102 -0
- data/app/assets/stylesheets/virgo/admin/slideshow.sass +35 -0
- data/app/assets/stylesheets/virgo/admin/users.sass +2 -0
- data/app/assets/stylesheets/virgo/admin_only.sass +1 -0
- data/app/assets/stylesheets/virgo/application.sass +605 -0
- data/app/assets/stylesheets/virgo/columns.sass +51 -0
- data/app/assets/stylesheets/virgo/install.sass +15 -0
- data/app/assets/stylesheets/virgo/lib/bootstrap/bootstrap-imports.sass +9 -0
- data/app/assets/stylesheets/virgo/lib/bootstrap/bootstrap-overrides.sass +51 -0
- data/app/assets/stylesheets/virgo/lib/bootstrap/bootstrap-variables.sass +27 -0
- data/app/assets/stylesheets/virgo/lib/jquery-ui-multiselect.css +30 -0
- data/app/assets/stylesheets/virgo/lib/manifest.sass +3 -0
- data/app/assets/stylesheets/virgo/lib/ouibounce.css +222 -0
- data/app/assets/stylesheets/virgo/lib/select2-imports.sass +8 -0
- data/app/assets/stylesheets/virgo/page_modules.sass +54 -0
- data/app/assets/stylesheets/virgo/pages/authors.sass +30 -0
- data/app/assets/stylesheets/virgo/posts.sass +782 -0
- data/app/assets/stylesheets/virgo/search.sass +36 -0
- data/app/assets/stylesheets/virgo/ui.sass +434 -0
- data/app/assets/stylesheets/virgo/users.sass +9 -0
- data/app/controllers/virgo/admin/base_controller.rb +22 -0
- data/app/controllers/virgo/admin/categories_controller.rb +90 -0
- data/app/controllers/virgo/admin/columns_controller.rb +65 -0
- data/app/controllers/virgo/admin/images_controller.rb +89 -0
- data/app/controllers/virgo/admin/media_modal_controller.rb +101 -0
- data/app/controllers/virgo/admin/newsletters_controller.rb +37 -0
- data/app/controllers/virgo/admin/page_modules_controller.rb +62 -0
- data/app/controllers/virgo/admin/pages_controller.rb +6 -0
- data/app/controllers/virgo/admin/posts_controller.rb +173 -0
- data/app/controllers/virgo/admin/sites_controller.rb +31 -0
- data/app/controllers/virgo/admin/slides_controller.rb +71 -0
- data/app/controllers/virgo/admin/slideshows_controller.rb +66 -0
- data/app/controllers/virgo/admin/tags_controller.rb +98 -0
- data/app/controllers/virgo/admin/users/sessions_controller.rb +21 -0
- data/app/controllers/virgo/admin/users_controller.rb +84 -0
- data/app/controllers/virgo/application_controller.rb +151 -0
- data/app/controllers/virgo/categories_controller.rb +20 -0
- data/app/controllers/virgo/columns_controller.rb +24 -0
- data/app/controllers/virgo/images_controller.rb +9 -0
- data/app/controllers/virgo/install_controller.rb +46 -0
- data/app/controllers/virgo/page_modules_controller.rb +23 -0
- data/app/controllers/virgo/pages_controller.rb +29 -0
- data/app/controllers/virgo/posts_controller.rb +101 -0
- data/app/controllers/virgo/search_controller.rb +35 -0
- data/app/controllers/virgo/subscribers_controller.rb +54 -0
- data/app/controllers/virgo/tags_controller.rb +15 -0
- data/app/controllers/virgo/users/confirmations_controller.rb +18 -0
- data/app/controllers/virgo/users/passwords_controller.rb +31 -0
- data/app/controllers/virgo/users/registrations_controller.rb +41 -0
- data/app/controllers/virgo/users/sessions_controller.rb +32 -0
- data/app/controllers/virgo/users_controller.rb +15 -0
- data/app/helpers/virgo/admin/post_helper.rb +54 -0
- data/app/helpers/virgo/admin_helper.rb +15 -0
- data/app/helpers/virgo/application_helper.rb +124 -0
- data/app/helpers/virgo/hooks_helper.rb +30 -0
- data/app/helpers/virgo/page_modules_helper.rb +4 -0
- data/app/helpers/virgo/post_helper.rb +159 -0
- data/app/helpers/virgo/render_helper.rb +33 -0
- data/app/helpers/virgo/search_helper.rb +49 -0
- data/app/helpers/virgo/shortcode_helper.rb +7 -0
- data/app/helpers/virgo/text_helper.rb +12 -0
- data/app/helpers/virgo/video_helper.rb +34 -0
- data/app/models/concerns/virgo/common/slug_history.rb +36 -0
- data/app/models/concerns/virgo/common/uuid.rb +22 -0
- data/app/models/concerns/virgo/post/recommendations.rb +15 -0
- data/app/models/concerns/virgo/post/search.rb +100 -0
- data/app/models/concerns/virgo/user/search.rb +39 -0
- data/app/models/virgo/ability.rb +59 -0
- data/app/models/virgo/category.rb +44 -0
- data/app/models/virgo/column.rb +25 -0
- data/app/models/virgo/form_model.rb +19 -0
- data/app/models/virgo/image.rb +63 -0
- data/app/models/virgo/page_module.rb +42 -0
- data/app/models/virgo/page_module_post.rb +8 -0
- data/app/models/virgo/post.rb +391 -0
- data/app/models/virgo/post_category.rb +8 -0
- data/app/models/virgo/post_search.rb +7 -0
- data/app/models/virgo/post_tag.rb +10 -0
- data/app/models/virgo/site.rb +36 -0
- data/app/models/virgo/slide.rb +23 -0
- data/app/models/virgo/slideshow.rb +37 -0
- data/app/models/virgo/slug_history.rb +5 -0
- data/app/models/virgo/subscriber.rb +5 -0
- data/app/models/virgo/tag.rb +34 -0
- data/app/models/virgo/user.rb +145 -0
- data/app/uploaders/virgo/application_uploader.rb +11 -0
- data/app/uploaders/virgo/avatar_uploader.rb +21 -0
- data/app/uploaders/virgo/featured_image_uploader.rb +28 -0
- data/app/uploaders/virgo/image_uploader.rb +40 -0
- data/app/uploaders/virgo/slide_uploader.rb +19 -0
- data/app/views/layouts/virgo/admin.haml +16 -0
- data/app/views/layouts/virgo/admin/site_settings.haml +14 -0
- data/app/views/layouts/virgo/application.haml +63 -0
- data/app/views/layouts/virgo/errors.haml +42 -0
- data/app/views/layouts/virgo/main.haml +5 -0
- data/app/views/layouts/virgo/posts.haml +10 -0
- data/app/views/virgo/admin/categories/_form.haml +19 -0
- data/app/views/virgo/admin/categories/edit.haml +7 -0
- data/app/views/virgo/admin/categories/index.haml +38 -0
- data/app/views/virgo/admin/categories/modal_form.haml +11 -0
- data/app/views/virgo/admin/categories/new.haml +7 -0
- data/app/views/virgo/admin/categories/success_modal.haml +14 -0
- data/app/views/virgo/admin/columns/_form.haml +30 -0
- data/app/views/virgo/admin/columns/edit.haml +1 -0
- data/app/views/virgo/admin/columns/index.haml +30 -0
- data/app/views/virgo/admin/columns/new.haml +1 -0
- data/app/views/virgo/admin/images/_form.haml +46 -0
- data/app/views/virgo/admin/images/edit.haml +1 -0
- data/app/views/virgo/admin/images/index.haml +32 -0
- data/app/views/virgo/admin/images/new.haml +1 -0
- data/app/views/virgo/admin/media_modal/_image_settings.haml +17 -0
- data/app/views/virgo/admin/media_modal/_library_panel.haml +26 -0
- data/app/views/virgo/admin/media_modal/_upload_panel.haml +21 -0
- data/app/views/virgo/admin/media_modal/_upload_success.haml +7 -0
- data/app/views/virgo/admin/media_modal/index.haml +19 -0
- data/app/views/virgo/admin/newsletters/changelog.haml +25 -0
- data/app/views/virgo/admin/newsletters/edit.haml +6 -0
- data/app/views/virgo/admin/page_modules/edit.haml +33 -0
- data/app/views/virgo/admin/page_modules/edit_subject.haml +43 -0
- data/app/views/virgo/admin/pages/help.haml +114 -0
- data/app/views/virgo/admin/posts/_author_dropdown.haml +1 -0
- data/app/views/virgo/admin/posts/_categories_form.haml +7 -0
- data/app/views/virgo/admin/posts/_category.haml +22 -0
- data/app/views/virgo/admin/posts/_form.haml +201 -0
- data/app/views/virgo/admin/posts/_revisions.haml +40 -0
- data/app/views/virgo/admin/posts/edit.haml +9 -0
- data/app/views/virgo/admin/posts/index.haml +59 -0
- data/app/views/virgo/admin/posts/new.haml +1 -0
- data/app/views/virgo/admin/posts/revision_detail.haml +28 -0
- data/app/views/virgo/admin/posts/revisions.haml +3 -0
- data/app/views/virgo/admin/sites/edit.haml +12 -0
- data/app/views/virgo/admin/slides/_form.haml +41 -0
- data/app/views/virgo/admin/slides/edit.haml +1 -0
- data/app/views/virgo/admin/slides/new.haml +1 -0
- data/app/views/virgo/admin/slideshows/_form.haml +49 -0
- data/app/views/virgo/admin/slideshows/edit.haml +1 -0
- data/app/views/virgo/admin/slideshows/index.haml +43 -0
- data/app/views/virgo/admin/slideshows/new.haml +1 -0
- data/app/views/virgo/admin/tags/_form.haml +16 -0
- data/app/views/virgo/admin/tags/edit.haml +7 -0
- data/app/views/virgo/admin/tags/index.haml +33 -0
- data/app/views/virgo/admin/tags/modal_form.haml +12 -0
- data/app/views/virgo/admin/tags/new.haml +7 -0
- data/app/views/virgo/admin/tags/success_modal.haml +14 -0
- data/app/views/virgo/admin/users/_form.haml +62 -0
- data/app/views/virgo/admin/users/edit.haml +1 -0
- data/app/views/virgo/admin/users/index.haml +34 -0
- data/app/views/virgo/admin/users/new.haml +1 -0
- data/app/views/virgo/application/sitemap.xml.builder +0 -0
- data/app/views/virgo/authors/_profile_long.haml +13 -0
- data/app/views/virgo/authors/_profile_short.haml +10 -0
- data/app/views/virgo/categories/show.haml +24 -0
- data/app/views/virgo/columns/index.haml +19 -0
- data/app/views/virgo/columns/show.haml +18 -0
- data/app/views/virgo/common/_admin_navbar.haml +100 -0
- data/app/views/virgo/common/_alerts.haml +40 -0
- data/app/views/virgo/common/_analytics.html.erb +1 -0
- data/app/views/virgo/common/_base_errors.haml +8 -0
- data/app/views/virgo/common/_category_heading.haml +26 -0
- data/app/views/virgo/common/_disqus.html.erb +24 -0
- data/app/views/virgo/common/_disqus_comment_count.html.erb +12 -0
- data/app/views/virgo/common/_fb_api.html.erb +30 -0
- data/app/views/virgo/common/_fonts.html.erb +1 -0
- data/app/views/virgo/common/_footer.haml +13 -0
- data/app/views/virgo/common/_footer_javascript.html.erb +0 -0
- data/app/views/virgo/common/_header_analytics.html.erb +9 -0
- data/app/views/virgo/common/_list_signup.haml +20 -0
- data/app/views/virgo/common/_ouibounce_modal.haml +26 -0
- data/app/views/virgo/common/_public_nav.haml +58 -0
- data/app/views/virgo/common/_search_form.haml +8 -0
- data/app/views/virgo/common/_share_bar.haml +45 -0
- data/app/views/virgo/common/_user_vars.haml +2 -0
- data/app/views/virgo/errors/404.haml +10 -0
- data/app/views/virgo/errors/500.haml +10 -0
- data/app/views/virgo/images/_shortcode.haml +4 -0
- data/app/views/virgo/install/index.haml +58 -0
- data/app/views/virgo/install/success.haml +12 -0
- data/app/views/virgo/page_modules/_latest_posts.haml +29 -0
- data/app/views/virgo/page_modules/_popular_posts.haml +51 -0
- data/app/views/virgo/pages/authors.haml +8 -0
- data/app/views/virgo/pages/home.haml +0 -0
- data/app/views/virgo/pages/show.haml +6 -0
- data/app/views/virgo/posts/_author_info.haml +16 -0
- data/app/views/virgo/posts/_post_full.haml +63 -0
- data/app/views/virgo/posts/_post_short.haml +30 -0
- data/app/views/virgo/posts/_post_thumb_box.haml +13 -0
- data/app/views/virgo/posts/_recommendations.haml +12 -0
- data/app/views/virgo/posts/_sidebar_thumb.haml +4 -0
- data/app/views/virgo/posts/index.haml +22 -0
- data/app/views/virgo/posts/latest.haml +16 -0
- data/app/views/virgo/posts/more.haml +10 -0
- data/app/views/virgo/posts/rss.xml.builder +17 -0
- data/app/views/virgo/posts/show.haml +17 -0
- data/app/views/virgo/search/_form.haml +5 -0
- data/app/views/virgo/search/_item.haml +22 -0
- data/app/views/virgo/search/index.haml +11 -0
- data/app/views/virgo/search/new.haml +4 -0
- data/app/views/virgo/shortcode_templates/blockquote.haml +9 -0
- data/app/views/virgo/shortcode_templates/h1.haml +1 -0
- data/app/views/virgo/shortcode_templates/h2.haml +1 -0
- data/app/views/virgo/shortcode_templates/h3.haml +1 -0
- data/app/views/virgo/shortcode_templates/h4.haml +1 -0
- data/app/views/virgo/shortcode_templates/image.haml +17 -0
- data/app/views/virgo/shortcode_templates/pullquote.haml +3 -0
- data/app/views/virgo/shortcode_templates/slideshow.haml +35 -0
- data/app/views/virgo/shortcode_templates/tweet.haml +3 -0
- data/app/views/virgo/shortcode_templates/video.haml +8 -0
- data/app/views/virgo/subscribers/_success_modal.haml +13 -0
- data/app/views/virgo/subscribers/modal.haml +15 -0
- data/app/views/virgo/tags/show.haml +16 -0
- data/app/views/virgo/users/confirmations/new.html.haml +10 -0
- data/app/views/virgo/users/devise_mailer/confirmation_instructions.html.erb +7 -0
- data/app/views/virgo/users/devise_mailer/reset_password_instructions.html.haml +6 -0
- data/app/views/virgo/users/devise_mailer/unlock_instructions.html.haml +5 -0
- data/app/views/virgo/users/passwords/edit.html.haml +14 -0
- data/app/views/virgo/users/passwords/new.html.haml +14 -0
- data/app/views/virgo/users/registrations/edit.html.haml +30 -0
- data/app/views/virgo/users/registrations/new.html.haml +13 -0
- data/app/views/virgo/users/sessions/new.html.haml +12 -0
- data/app/views/virgo/users/shared/_links.haml +26 -0
- data/app/views/virgo/users/show.haml +11 -0
- data/app/views/virgo/users/unlocks/new.html.haml +9 -0
- data/config/initializers/action_mailer.rb +7 -0
- data/config/initializers/active_record.rb +72 -0
- data/config/initializers/active_record_symbolize.rb +18 -0
- data/config/initializers/assets.rb +17 -0
- data/config/initializers/backtrace_silencers.rb +7 -0
- data/config/initializers/carrierwave.rb +36 -0
- data/config/initializers/cookies_serializer.rb +3 -0
- data/config/initializers/devise.rb +257 -0
- data/config/initializers/filter_parameter_logging.rb +4 -0
- data/config/initializers/hash.rb +5 -0
- data/config/initializers/inflections.rb +16 -0
- data/config/initializers/mime_types.rb +4 -0
- data/config/initializers/nil_class.rb +13 -0
- data/config/initializers/non_digest_assets.rb +3 -0
- data/config/initializers/paper_trail.rb +30 -0
- data/config/initializers/schema_plus.rb +5 -0
- data/config/initializers/session_store.rb +3 -0
- data/config/initializers/shortcode.rb +12 -0
- data/config/initializers/simple_form.rb +170 -0
- data/config/initializers/simple_form_bootstrap.rb +136 -0
- data/config/initializers/string.rb +5 -0
- data/config/initializers/time_formatting.rb +23 -0
- data/config/initializers/wrap_parameters.rb +14 -0
- data/config/locales/devise.en.yml +60 -0
- data/config/routes.rb +96 -0
- data/config/schedule.rb +3 -0
- data/db/migrate/20150729174510_create_virgo_schema.rb +225 -0
- data/lib/generators/virgo/install/install_generator.rb +16 -0
- data/lib/generators/virgo/views/views_generator.rb +22 -0
- data/lib/tasks/virgo_tasks.rake +7 -0
- data/lib/virgo.rb +4 -0
- data/lib/virgo/development_mail_interceptor.rb +6 -0
- data/lib/virgo/email_validator.rb +6 -0
- data/lib/virgo/engine.rb +73 -0
- data/lib/virgo/reduce_validator.rb +6 -0
- data/lib/virgo/upload_helpers.rb +89 -0
- data/lib/virgo/version.rb +3 -0
- data/lib/virgo/view_help.rb +3 -0
- metadata +1051 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 22fa9b35373b3656f014114d351d4e928fa875f6
|
4
|
+
data.tar.gz: 4069006ffe4c5cd97e164b26e06e6e57e89add6a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: eb3b6249266bc415083c1524f7afd51e7bb1d26b4a824bac8be679ffceeb7d5898b06b50e3fc720d8cee241ee84ae25e9be9a7b849bae7306fcdddbf1f7b3ad8
|
7
|
+
data.tar.gz: 653ea4f7e163815ee275fb486ec9eff0e456b5ae803054be718af121bafb31c726991ddaf211c1360423b78d3389026c191462ed0338e62610a65aec3e8951b9
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2015 Nicholas Zaillian
|
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/Rakefile
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'rdoc/task'
|
8
|
+
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
11
|
+
rdoc.title = 'Virgo'
|
12
|
+
rdoc.options << '--line-numbers'
|
13
|
+
rdoc.rdoc_files.include('README.rdoc')
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
+
end
|
16
|
+
|
17
|
+
APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
|
18
|
+
load 'rails/tasks/engine.rake'
|
19
|
+
|
20
|
+
|
21
|
+
load 'rails/tasks/statistics.rake'
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
Bundler::GemHelper.install_tasks
|
26
|
+
|
27
|
+
require 'rake/testtask'
|
28
|
+
|
29
|
+
Rake::TestTask.new(:test) do |t|
|
30
|
+
t.libs << 'lib'
|
31
|
+
t.libs << 'test'
|
32
|
+
t.pattern = 'test/**/*_test.rb'
|
33
|
+
t.verbose = false
|
34
|
+
end
|
35
|
+
|
36
|
+
|
37
|
+
task default: :test
|
@@ -0,0 +1 @@
|
|
1
|
+
#= require tinymce-jquery
|
@@ -0,0 +1,234 @@
|
|
1
|
+
###
|
2
|
+
plugin.js
|
3
|
+
|
4
|
+
Copyright, Moxiecode Systems AB
|
5
|
+
Released under LGPL License.
|
6
|
+
|
7
|
+
License: http://www.tinymce.com/license
|
8
|
+
Contributing: http://www.tinymce.com/contributing
|
9
|
+
###
|
10
|
+
|
11
|
+
#global tinymce:true
|
12
|
+
|
13
|
+
class ImageManager
|
14
|
+
constructor: (@editor) ->
|
15
|
+
new window.MediaModal({
|
16
|
+
image_uploaded_callback: @on_image_uploaded,
|
17
|
+
image_selected_callback: @on_image_selected
|
18
|
+
})
|
19
|
+
|
20
|
+
@bind_events()
|
21
|
+
|
22
|
+
@editor.addButton "image",
|
23
|
+
icon: "image"
|
24
|
+
tooltip: "Insert/edit image"
|
25
|
+
onclick: =>
|
26
|
+
@media_modal_mode = 'normal'
|
27
|
+
@show_dialog()
|
28
|
+
stateSelector: "img:not([data-mce-object],[data-mce-placeholder])"
|
29
|
+
|
30
|
+
@editor.addMenuItem "image",
|
31
|
+
icon: "image"
|
32
|
+
text: "Insert/edit image"
|
33
|
+
onclick: =>
|
34
|
+
@media_modal_mode = 'normal'
|
35
|
+
@show_dialog()
|
36
|
+
context: "insert"
|
37
|
+
prependToContext: true
|
38
|
+
|
39
|
+
|
40
|
+
bind_events: =>
|
41
|
+
@editor.addCommand "mceImage", @show_dialog
|
42
|
+
@editor.on 'dblclick', @on_editor_click
|
43
|
+
|
44
|
+
$('body').on 'submit', '.image-settings-form', @submit_image_settings_modal
|
45
|
+
$('body').on 'click', '.js-remove-featured-image', @remove_featured_image
|
46
|
+
$('body').on 'click', '.js-remove-thumbnail-image', @remove_thumbnail_image
|
47
|
+
|
48
|
+
$('body').on 'click', '.js-launch-media-modal', (e) =>
|
49
|
+
@media_modal_mode = 'normal'
|
50
|
+
@show_dialog(e)
|
51
|
+
|
52
|
+
$('body').on 'click', '.js-select-featured-image', (e) =>
|
53
|
+
e.preventDefault()
|
54
|
+
@media_modal_mode = 'featured_image'
|
55
|
+
@show_dialog(e)
|
56
|
+
|
57
|
+
$('body').on 'click', '.js-select-thumbnail-image', (e) =>
|
58
|
+
e.preventDefault()
|
59
|
+
@media_modal_mode = 'thumbnail_image'
|
60
|
+
@show_dialog(e)
|
61
|
+
|
62
|
+
$('body').on 'hidden.bs.modal', '#media-modal, #image-settings-modal', ->
|
63
|
+
$(this).data('bs.modal', null)
|
64
|
+
$(this).remove()
|
65
|
+
|
66
|
+
$('body').on 'click', '.paginator.last-page', (e) =>
|
67
|
+
e.preventDefault()
|
68
|
+
e.stopPropagation()
|
69
|
+
|
70
|
+
show_dialog: (e) =>
|
71
|
+
$(document).trigger("showMediaModal", {mode: @media_modal_mode})
|
72
|
+
|
73
|
+
present_image_settings_modal: (el) =>
|
74
|
+
img_id = el.attr('data-id')
|
75
|
+
caption = encodeURIComponent(el.attr("data-caption") || "")
|
76
|
+
|
77
|
+
$.get "/admin/media_modal/image_settings/#{img_id}", {caption: caption}, (response) =>
|
78
|
+
if $('#image-settings-modal').length
|
79
|
+
$('#image-settings-modal').modal('hide').data('bs.modal', null).remove()
|
80
|
+
|
81
|
+
$modal = $(response.html)
|
82
|
+
$('body').prepend($modal)
|
83
|
+
$modal.modal()
|
84
|
+
|
85
|
+
remove_featured_image: (e) =>
|
86
|
+
e.preventDefault()
|
87
|
+
|
88
|
+
$link = $(e.currentTarget)
|
89
|
+
|
90
|
+
if confirm "Are you sure you would like to remove the featured image from this post (note: removing the featured image from the post will not remove the image from the media library)."
|
91
|
+
if $link.attr('href') != '#' # '#' indicates post is not yet persisted
|
92
|
+
$.ajax
|
93
|
+
type: 'DELETE'
|
94
|
+
url: $link.attr('href')
|
95
|
+
|
96
|
+
$("input[name='post[featured_image_id]']").val("")
|
97
|
+
$(".featured-image-thumbnail").html("<span class='text-muted empty'>No image selected</span>")
|
98
|
+
alert("Featured image successfully removed")
|
99
|
+
|
100
|
+
remove_thumbnail_image: (e) =>
|
101
|
+
e.preventDefault()
|
102
|
+
|
103
|
+
$link = $(e.currentTarget)
|
104
|
+
|
105
|
+
if confirm "Are you sure you would like to remove the thumbnail image from this post (note: removing the thumbnail image from the post will not remove the image from the media library)."
|
106
|
+
if $link.attr('href') != '#' # '#' indicates post is not yet persisted
|
107
|
+
$.ajax
|
108
|
+
type: 'DELETE'
|
109
|
+
url: $link.attr('href')
|
110
|
+
|
111
|
+
$("input[name='post[thumbnail_image_id]']").val("")
|
112
|
+
$(".thumbnail-image-thumbnail").html("<span class='text-muted empty'>No image selected</span>")
|
113
|
+
alert("Thumbnail image successfully removed")
|
114
|
+
|
115
|
+
get_image_html: (url, callback) =>
|
116
|
+
$.get url, (response) =>
|
117
|
+
callback(response.html)
|
118
|
+
|
119
|
+
on_editor_click: (e) =>
|
120
|
+
if $(e.target).hasClass('post-img')
|
121
|
+
$img = $(e.target)
|
122
|
+
@present_image_settings_modal($img)
|
123
|
+
|
124
|
+
true
|
125
|
+
|
126
|
+
submit_image_settings_modal: (e) =>
|
127
|
+
e.preventDefault()
|
128
|
+
|
129
|
+
$form = $(e.currentTarget)
|
130
|
+
|
131
|
+
$.ajax
|
132
|
+
type: 'PATCH'
|
133
|
+
url: $form.attr('action')
|
134
|
+
data: $form.serialize()
|
135
|
+
|
136
|
+
success: (response) =>
|
137
|
+
if response.status == 'success'
|
138
|
+
img = $(@editor.selection.getNode())
|
139
|
+
img.attr('alt', response.image.alt_text)
|
140
|
+
if response.caption and response.caption != ''
|
141
|
+
img.attr('data-caption', encodeURIComponent(response.caption))
|
142
|
+
if response.image.credit and response.image.credit != ''
|
143
|
+
img.attr('data-credit', encodeURIComponent(response.image.credit))
|
144
|
+
$('#image-settings-modal .close').click()
|
145
|
+
else
|
146
|
+
$(".image-settings-form").html($(response.html).find('.image-settings-form').html())
|
147
|
+
|
148
|
+
|
149
|
+
on_image_uploaded: (image, image_html) =>
|
150
|
+
if @media_modal_mode == 'normal'
|
151
|
+
# img_tag = response.image_html
|
152
|
+
data = image
|
153
|
+
|
154
|
+
image_attrs =
|
155
|
+
src: data.content_image
|
156
|
+
alt: data.alt_text
|
157
|
+
class: 'post-img'
|
158
|
+
'data-id': data.id
|
159
|
+
'data-credit': data.credit
|
160
|
+
|
161
|
+
@editor.undoManager.transact =>
|
162
|
+
image_attrs.id = "__mcenew"
|
163
|
+
@editor.focus()
|
164
|
+
@editor.selection.setContent @editor.dom.createHTML("img", image_attrs)
|
165
|
+
img_elem = @editor.dom.get("__mcenew")
|
166
|
+
@editor.dom.setAttrib img_elem, "id", null
|
167
|
+
|
168
|
+
if @editor.selection
|
169
|
+
@editor.selection.select img_elem
|
170
|
+
@editor.nodeChanged()
|
171
|
+
else if @media_modal_mode == 'thumbnail_image'
|
172
|
+
$input = $("input[name='post[thumbnail_image_id]']")
|
173
|
+
$input.val(image.id)
|
174
|
+
img_tag = $(image_html)
|
175
|
+
$(".js-save-thumbnail-image").removeClass('hidden')
|
176
|
+
$(".js-no-thumbnail-image-message").addClass("hidden")
|
177
|
+
$(".thumbnail-image-thumbnail").html(img_tag.find('img').outerHTML())
|
178
|
+
$("#media-modal .close").click()
|
179
|
+
else
|
180
|
+
$input = $("input[name='post[thumbnail_image_id]']")
|
181
|
+
$input.val(image.id)
|
182
|
+
img_tag = $(image_html)
|
183
|
+
$(".js-save-featured-image").removeClass('hidden')
|
184
|
+
$(".js-no-featured-image-message").addClass("hidden")
|
185
|
+
$(".featured-image-thumbnail").html(img_tag.find('img').outerHTML())
|
186
|
+
$("#media-modal .close").click()
|
187
|
+
|
188
|
+
on_image_selected: (data) =>
|
189
|
+
if @media_modal_mode == 'normal'
|
190
|
+
image_attrs =
|
191
|
+
src: data.content_image
|
192
|
+
alt: data.alt_text
|
193
|
+
class: 'post-img'
|
194
|
+
'data-id': data.id
|
195
|
+
|
196
|
+
if data.credit? and data.credit != '' and data.credit != 'null'
|
197
|
+
image_attrs['data-credit'] = encodeURIComponent(data.credit)
|
198
|
+
|
199
|
+
if data.caption? and data.caption != '' and data.caption != 'null'
|
200
|
+
image_attrs['data-caption'] = encodeURIComponent(data.caption)
|
201
|
+
|
202
|
+
@editor.undoManager.transact =>
|
203
|
+
image_attrs.id = "__mcenew"
|
204
|
+
@editor.focus()
|
205
|
+
@editor.selection.setContent @editor.dom.createHTML("img", image_attrs)
|
206
|
+
img_elem = @editor.dom.get("__mcenew")
|
207
|
+
@editor.dom.setAttrib img_elem, "id", null
|
208
|
+
|
209
|
+
if @editor.selection
|
210
|
+
@editor.selection.select img_elem
|
211
|
+
@editor.nodeChanged()
|
212
|
+
|
213
|
+
$('.media-modal-dialog .close').click()
|
214
|
+
|
215
|
+
else if @media_modal_mode == 'thumbnail_image'
|
216
|
+
$input = $("input[name='post[thumbnail_image_id]']")
|
217
|
+
$input.val(data.id)
|
218
|
+
|
219
|
+
$(".js-save-thumbnail-image").removeClass('hidden')
|
220
|
+
$(".js-no-thumbnail-image-message").addClass("hidden")
|
221
|
+
$(".thumbnail-image-thumbnail").removeClass("hidden").find("img").attr("src", data.med_thumb_image)
|
222
|
+
$("#media-modal .close").click()
|
223
|
+
else
|
224
|
+
$input = $("input[name='post[featured_image_id]']")
|
225
|
+
$input.val(data.id)
|
226
|
+
|
227
|
+
$(".js-save-featured-image").removeClass('hidden')
|
228
|
+
$(".js-no-featured-image-message").addClass("hidden")
|
229
|
+
$(".featured-image-thumbnail").removeClass("hidden").find("img").attr("src", data.med_thumb_image)
|
230
|
+
$("#media-modal .close").click()
|
231
|
+
|
232
|
+
|
233
|
+
tinymce.PluginManager.add "image_manager", (editor) ->
|
234
|
+
new ImageManager(editor)
|
@@ -0,0 +1,29 @@
|
|
1
|
+
class PageModuleEditSubjectForm
|
2
|
+
constructor: ->
|
3
|
+
@init_multiselect()
|
4
|
+
@post_select = $('#page-module-subject-select')
|
5
|
+
@subject_id_input = $("#page_module_subject_id")
|
6
|
+
@clear_link = $(".js-clear-page-module-subject")
|
7
|
+
|
8
|
+
@post_select.autocomplete
|
9
|
+
source: (request, response) =>
|
10
|
+
$.get "/admin/posts/find", {term: request.term}, (resp) =>
|
11
|
+
data = []
|
12
|
+
|
13
|
+
for item in resp.posts
|
14
|
+
data.push({label: item.headline, value: item.headline, subject_id: item.id})
|
15
|
+
|
16
|
+
response(data)
|
17
|
+
|
18
|
+
select: (event, ui) =>
|
19
|
+
@subject_id_input.val(ui.item.subject_id)
|
20
|
+
|
21
|
+
@clear_link.click (e) =>
|
22
|
+
e.preventDefault()
|
23
|
+
@post_select.val("")
|
24
|
+
@subject_id_input.val("")
|
25
|
+
|
26
|
+
init_multiselect: =>
|
27
|
+
$('.js-post-multiselect').multiselect()
|
28
|
+
|
29
|
+
window.PageModuleEditSubjectForm = PageModuleEditSubjectForm
|
@@ -0,0 +1,35 @@
|
|
1
|
+
class PostEditLocking
|
2
|
+
constructor: ->
|
3
|
+
@status_uri = window.post_edit_status_uri
|
4
|
+
@interval = window.post_status_interval
|
5
|
+
@editor_id = window.post_editor_id
|
6
|
+
@user_id = window.user_id
|
7
|
+
|
8
|
+
@was_editor = (@editor_id == @user_id)
|
9
|
+
|
10
|
+
# if the current user is NOT the locker of the post,
|
11
|
+
# we want him to poll at a less frequent interval
|
12
|
+
# to give the locker space in the case that
|
13
|
+
# they have a momentary network hiccup and can't lock
|
14
|
+
# on first attempt
|
15
|
+
if !@was_editor
|
16
|
+
@interval += window.post_status_grace
|
17
|
+
|
18
|
+
setInterval @push_status, @interval
|
19
|
+
|
20
|
+
push_status: =>
|
21
|
+
# attempt lock...
|
22
|
+
$.post @status_uri, (response) =>
|
23
|
+
if !@was_editor && response.edit_lock_succeeded
|
24
|
+
if confirm "#{response.editor_byline} has finished editing this post. Click OK to refresh this page and view the updated post content."
|
25
|
+
window.location.reload()
|
26
|
+
|
27
|
+
@was_editor = true
|
28
|
+
|
29
|
+
# ensure lock message is always shown when another user locks the post
|
30
|
+
if response.editor_is_self != true
|
31
|
+
$(".editing-user-name").html(response.editor_byline)
|
32
|
+
$("#post-locked-message").removeClass("hidden")
|
33
|
+
|
34
|
+
|
35
|
+
window.PostEditLocking = PostEditLocking
|
@@ -0,0 +1,183 @@
|
|
1
|
+
class AdminPostForm
|
2
|
+
constructor: ->
|
3
|
+
tinyMCE.init({
|
4
|
+
selector: '.editor-custom'
|
5
|
+
skin: 'railspress'
|
6
|
+
inline_styles: false
|
7
|
+
apply_source_formatting: false
|
8
|
+
extended_valid_elements: "link,style"
|
9
|
+
valid_children : "+body[style],+body[link],+div[link],+p[link],+div[style]"
|
10
|
+
height: 640
|
11
|
+
plugins: ["image_manager", "link", "wordcount", "code", "paste"]
|
12
|
+
object_resizing: false
|
13
|
+
menubar: "edit insert format" # tools"
|
14
|
+
paste_text_sticky: true
|
15
|
+
paste_text_sticky_default: true
|
16
|
+
toolbar: "styleselect | bold italic | undo redo | link | image | code "
|
17
|
+
})
|
18
|
+
$('#publish-at-input').datetimepicker()
|
19
|
+
@init_tag_select()
|
20
|
+
@bind_events()
|
21
|
+
|
22
|
+
bind_events: =>
|
23
|
+
$('body').on 'submit', '#category-form', @submit_category_form
|
24
|
+
$('body').on 'click', '#new-category-link', @present_category_form
|
25
|
+
$('body').on 'submit', '#tag-form', @submit_tag_form
|
26
|
+
$('body').on 'click', '#new-tag-link', @present_tag_form
|
27
|
+
$('body').on 'click', '.js-refresh-authors', @refresh_authors
|
28
|
+
$('body').on 'submit', '.admin-post-form', @clean_data
|
29
|
+
|
30
|
+
|
31
|
+
# remove modal from DOM when closed...
|
32
|
+
$('body').on 'hidden.bs.modal', '#category-modal', ->
|
33
|
+
$(this).data('bs.modal', null)
|
34
|
+
$(this).remove()
|
35
|
+
|
36
|
+
init_tag_select: =>
|
37
|
+
_val = $.parseJSON($('.tags-select').val())
|
38
|
+
|
39
|
+
$('.tags-select').select2({
|
40
|
+
data: @all_tag_objects(),
|
41
|
+
multiple: true
|
42
|
+
})
|
43
|
+
|
44
|
+
$('.tags-select').select2("val", _val)
|
45
|
+
|
46
|
+
$('.tags-select').select2("container").find("ul.select2-choices").sortable({
|
47
|
+
containment: 'parent'
|
48
|
+
start: -> $('.tags-select').select2("onSortStart")
|
49
|
+
update: -> $('.tags-select').select2("onSortEnd")
|
50
|
+
})
|
51
|
+
|
52
|
+
all_tag_names: =>
|
53
|
+
Object.keys(window.tag_info)
|
54
|
+
|
55
|
+
selected_tag_names: =>
|
56
|
+
ids = $.parseJSON($('.tags-select').val())
|
57
|
+
collection = []
|
58
|
+
|
59
|
+
for id in ids
|
60
|
+
collection.push(@tag_name(id))
|
61
|
+
|
62
|
+
collection
|
63
|
+
|
64
|
+
tag_name: (tag_id) =>
|
65
|
+
invertObject(window.tag_info)[tag_id]
|
66
|
+
|
67
|
+
tag_id: (tag_name) =>
|
68
|
+
window.tag_info[tag_name]
|
69
|
+
|
70
|
+
all_tag_objects: =>
|
71
|
+
objs = []
|
72
|
+
|
73
|
+
for k,v of invertObject(window.tag_info)
|
74
|
+
objs.push(id: k, text: v)
|
75
|
+
|
76
|
+
objs
|
77
|
+
|
78
|
+
submit_category_form: (e) =>
|
79
|
+
e.preventDefault()
|
80
|
+
|
81
|
+
$form = $(e.currentTarget)
|
82
|
+
|
83
|
+
$form.find('.js-submit-category').button('loading')
|
84
|
+
|
85
|
+
$.post $form.attr('action'), $form.serialize(), (response) =>
|
86
|
+
$(".modal-dialog").replaceWith($(response.html).find('.modal-dialog'))
|
87
|
+
$form.find('.js-submit-category').button('reset')
|
88
|
+
|
89
|
+
if response.status == "success"
|
90
|
+
$('.post-categories').replaceWith(response.categories_form_partial)
|
91
|
+
|
92
|
+
submit_tag_form: (e) =>
|
93
|
+
e.preventDefault()
|
94
|
+
|
95
|
+
$form = $(e.currentTarget)
|
96
|
+
|
97
|
+
$form.find('.js-submit-tag').button('loading')
|
98
|
+
|
99
|
+
$.post $form.attr('action'), $form.serialize(), (response) =>
|
100
|
+
$form.find('.js-submit-tag').button('reset')
|
101
|
+
|
102
|
+
$(".modal-dialog").replaceWith($(response.html).find('.modal-dialog'))
|
103
|
+
|
104
|
+
if response.status == "success"
|
105
|
+
newTag = response.tag
|
106
|
+
window.tag_info[newTag.name] = newTag.id
|
107
|
+
vals = $(".tags-select").select2("val")
|
108
|
+
vals.push(newTag.id.toString())
|
109
|
+
$(".tags-box-loading").show()
|
110
|
+
$(".tags-select").select2("destroy")
|
111
|
+
$(".tags-select").val("[#{vals.join(',')}]")
|
112
|
+
@init_tag_select()
|
113
|
+
$(".tags-select").select2("val", vals)
|
114
|
+
$(".tags-box-loading").hide()
|
115
|
+
|
116
|
+
present_category_form: (e) =>
|
117
|
+
e.preventDefault()
|
118
|
+
|
119
|
+
$link = $(e.currentTarget)
|
120
|
+
|
121
|
+
$.get $link.attr('data-uri'), (response) =>
|
122
|
+
if response.status == 'success'
|
123
|
+
if $('#category-modal').length
|
124
|
+
$('#category-modal').modal('hide').data('bs.modal', null).remove()
|
125
|
+
|
126
|
+
$modal = $(response.html)
|
127
|
+
$('body').prepend($modal)
|
128
|
+
$modal.modal()
|
129
|
+
|
130
|
+
present_tag_form: (e) =>
|
131
|
+
e.preventDefault()
|
132
|
+
|
133
|
+
$link = $(e.currentTarget)
|
134
|
+
|
135
|
+
$.get $link.attr('data-uri'), (response) =>
|
136
|
+
if response.status == 'success'
|
137
|
+
if $('#tag-modal').length
|
138
|
+
$('#tag-modal').modal('hide').data('bs.modal', null).remove()
|
139
|
+
|
140
|
+
$modal = $(response.html)
|
141
|
+
$('body').prepend($modal)
|
142
|
+
$modal.modal()
|
143
|
+
|
144
|
+
refresh_authors: (e) =>
|
145
|
+
e.preventDefault()
|
146
|
+
|
147
|
+
$link = $(e.currentTarget)
|
148
|
+
|
149
|
+
uri = $(".js-author-dropdown").attr("data-refresh-uri")
|
150
|
+
|
151
|
+
$link.find("i").addClass("fa-spin")
|
152
|
+
|
153
|
+
$.get uri, (response) =>
|
154
|
+
$link.find("i").removeClass("fa-spin")
|
155
|
+
$el = $(response.html)
|
156
|
+
$(".js-author-dropdown").replaceWith($el)
|
157
|
+
$el.effect('highlight', {}, 1000)
|
158
|
+
|
159
|
+
clean_data: (e) =>
|
160
|
+
$input = $("[name='post[body]']")
|
161
|
+
$html = $("<div>" + $input.val() + "</div>")
|
162
|
+
|
163
|
+
# remove empty divs and ps
|
164
|
+
$html.find("div, p").each ->
|
165
|
+
if $(this).html() == ""
|
166
|
+
$(this).remove()
|
167
|
+
|
168
|
+
$input.val($html.html())
|
169
|
+
|
170
|
+
tag_ids = $(".tags-select").select2("val")
|
171
|
+
|
172
|
+
tag_val_str = "[#{tag_ids.join(',')}]"
|
173
|
+
|
174
|
+
$(".tags-box-loading").show()
|
175
|
+
|
176
|
+
$(".tags-select").select2("destroy")
|
177
|
+
|
178
|
+
$(".tags-select").val(tag_val_str)
|
179
|
+
|
180
|
+
true
|
181
|
+
|
182
|
+
$ ->
|
183
|
+
new AdminPostForm if $('.admin-post-form').length
|