{"id":13473335,"url":"https://github.com/volmer/bootsy","last_synced_at":"2025-03-26T19:34:04.604Z","repository":{"id":3702250,"uuid":"4773417","full_name":"volmer/bootsy","owner":"volmer","description":"Disclaimer: this project is no longer maintained.","archived":true,"fork":false,"pushed_at":"2018-04-18T14:37:58.000Z","size":3562,"stargazers_count":450,"open_issues_count":7,"forks_count":172,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-10-30T06:31:10.239Z","etag":null,"topics":["bootstrap","rails","wysiwyg-editor"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/volmer.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-06-24T16:02:42.000Z","updated_at":"2024-10-07T01:39:15.000Z","dependencies_parsed_at":"2022-09-13T03:01:11.748Z","dependency_job_id":null,"html_url":"https://github.com/volmer/bootsy","commit_stats":null,"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/volmer%2Fbootsy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/volmer%2Fbootsy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/volmer%2Fbootsy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/volmer%2Fbootsy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/volmer","download_url":"https://codeload.github.com/volmer/bootsy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245722817,"owners_count":20661831,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bootstrap","rails","wysiwyg-editor"],"created_at":"2024-07-31T16:01:02.788Z","updated_at":"2025-03-26T19:34:03.800Z","avatar_url":"https://github.com/volmer.png","language":"Ruby","funding_links":[],"categories":["基于 Ruby","Ruby","For Ruby","WYSIWIG"],"sub_categories":[],"readme":"# Bootsy\n\n[![Gem Version](https://badge.fury.io/rb/bootsy.svg)](http://badge.fury.io/rb/bootsy)\n[![Build Status](https://secure.travis-ci.org/volmer/bootsy.svg?branch=master)](http://travis-ci.org/volmer/bootsy)\n\n### Disclaimer: this project is no longer maintained.\n\n*Bootsy* is a WYSIWYG editor for Rails based on\n[Bootstrap-wysihtml5](https://github.com/jhollingworth/bootstrap-wysihtml5) with image uploads using\n[CarrierWave](https://github.com/carrierwaveuploader/carrierwave).\n\n### Live demo\n\n* [bootsy-demo.herokuapp.com](http://bootsy-demo.herokuapp.com/)\n[![image](https://f.cloud.github.com/assets/301187/1365250/e1b7ba80-3854-11e3-9bfe-8bd1e090aca8.png)](http://bootsy-demo.herokuapp.com/)\n\n\n## Requirements\n\n* Rails 5.\n* ImageMagick or GraphicsMagick (for MiniMagick).\n* [Bootstrap 3](http://getbootstrap.com/) fully installed in your app.\n\n\n## Installation\n\n1. Add Bootsy to your Gemfile and `bundle install` it:\n  ```ruby\n  gem 'bootsy'\n  ```\n\n  ```console\n  bundle install\n  ```\n\n2. Mount Bootsy at the beginning of your `config/routes.rb`:\n  ```ruby\n  Rails.application.routes.draw do\n    mount Bootsy::Engine =\u003e '/bootsy', as: 'bootsy'\n\n    ...\n\n  end\n  ```\n\n3. Require Bootsy in the asset pipeline:\n\n  In your `app/assets/javascripts/application.js`, put this **after**\n  requiring jQuery and Bootstrap:\n\n  ```javascript\n  //= require bootsy\n  ```\n\n  In your `app/assets/stylesheets/application.css`, put this line **after**\n  requiring Bootstrap:\n\n  ```css\n  *= require bootsy\n  ```\n\n4. Add and run migrations:\n  ```console\n  bundle exec rake bootsy:install:migrations\n  bundle exec rake db:migrate\n  ```\n\n\n## Usage\n\nJust call `bootsy_area` in your `FormBuilder` instances, the\nsame way you'd call `textarea`. Example:\n```erb\n\u003c%= form_for(@post) do |f| %\u003e\n  \u003c%= f.label :title %\u003e\n  \u003c%= f.text_field :title %\u003e\n\n  \u003c%= f.label :content %\u003e\n  \u003c%= f.bootsy_area :content %\u003e\n\n  \u003c%= f.submit %\u003e\n\u003c% end %\u003e\n```\n\nBootsy will group the uploaded images as galleries and associate them to one of\nyour models. For instance, if you have a `Post` model and you want to use `bootsy_area`\nwith it, you must include the `Bootsy::Container` module:\n```ruby\nclass Post \u003c ActiveRecord::Base\n  include Bootsy::Container\nend\n```\n\nDon't forget to ensure the association between your model objects with Bootsy\nimage galleries. For `strong_parameters`, you must whitelist the `bootsy_image_gallery_id` parameter\nin your controller:\n```ruby\nprivate\n\ndef post_params\n  params.require(:post).permit(:title, :content, :bootsy_image_gallery_id)\nend\n```\n\n\n## Bootsy with [Simple Form](https://github.com/plataformatec/simple_form) builders\n\nYou can use `bootsy` as an input type in `SimpleForm::FormBuilder` instances. Example:\n```erb\n\u003c%= simple_form_for @post do |f| %\u003e\n  \u003c%= f.input :title %\u003e\n\n  \u003c%= f.input :content, as: :bootsy %\u003e\n\n  \u003c%= f.button :submit %\u003e\n\u003c% end %\u003e\n```\n\n\n## Editor options\n\nYou can customize Bootsy through a hash of `editor_options`:\n\n\n### Enable/disable features\n\nYou can enable and disable features as you like. For instance, if you don't want link and color features:\n```erb\n\u003c%= f.bootsy_area :my_attribute, editor_options: { link: false, color: false } %\u003e\n```\nAvailable options are: `:blockquote`, `:font_styles`, `:emphasis`, `:lists`, `:html`, `:link`, `:image` and `:color`.\n\n\n### Alert of unsaved changes\n\nBy default Bootsy alerts the user about unsaved changes if the page is closed or reloaded. You can disable\nthis feature with:\n```erb\n\u003c%= f.bootsy_area :my_attribute, editor_options: { alert_unsaved: false } %\u003e\n```\n\n## Uploads\n\nIf you don't want to have image uploads, just call `bootsy_area` in a form builder not\nassociated to a `Bootsy::Container` model. This way users will still be able to insert\nimages in the text area using an external image URL.\n\n\n## Configuration\n\nYou can set the default editor options, image sizes available (small, medium,\nlarge and/or its original), dimensions and more. Create a copy of [Bootsy's initalizer\nfile](https://github.com/volmer/bootsy/tree/master/config/initializers/bootsy.rb)\nin your `config/initializers` and feel free to uncomment and change the options\nas you like.\n\n\n## I18n\n\nYou can translate Bootsy to your own language. Simply create a locale file for\nit in your `config/locales` directory similar to [Bootsy's master English file](https://github.com/volmer/bootsy/tree/master/config/locales/bootsy.en.yml).\n\nYou also need to translate Bootsy on the JavaScript side. Just follow\n[this example](https://github.com/volmer/bootsy/blob/master/app/assets/javascripts/bootsy/locales/en.js).\nBootsy will try to guess the locale based on the `lang` attribute of the page's `\u003chtml\u003e` tag.\nYou can set the locale directly by setting a `data-bootsy-locale` attribute on your `\u003ctextarea\u003e`.\n\n\n## License\n\nMIT License. Copyright 2012-2017 Volmer Campos Soares\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvolmer%2Fbootsy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvolmer%2Fbootsy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvolmer%2Fbootsy/lists"}