Giter Site home page Giter Site logo

activeadmin-wysihtml5's Introduction

activeadmin-wysihtml5

⚠️ Unmaintained ⚠️

Sorry, but I no longer work on ActiveAdmin often enough to justify mantaining this gem. Take it as it is. If you are interested to update and maintain the gem, please let me know! ❤️

Screenshots

activeadmin-wysihtml5 screenshot

activeadmin-wysihtml5 screenshot

activeadmin-wysihtml5 screenshot

This is a wysiyg html editor for the Active Admin interface using wysihtml5.

Installation

# Gemfile

gem 'activeadmin-dragonfly', github: 'stefanoverna/activeadmin-dragonfly'
gem 'activeadmin-wysihtml5', github: 'stefanoverna/activeadmin-wysihtml5'

Now install the migrations:

$ rake activeadmin_wysihtml5:install:migrations
$ rake db:migrate

Usage

This gem provides you with a custom formtastic input called :wysihtml5 to build out an html editor. All you have to do is specify the :as option for your inputs.

Example

ActiveAdmin.register Page do
  form do |f|
    f.inputs do
      f.input :title
      f.input :content, as: :wysihtml5, commands: [ :link ], blocks: [ :h3, :p]
    end

    f.buttons
  end
end

Options

:commands

  • :all: all the available commands;
  • :basic: bold, italic, ul, ol, link, image, source (default)
  • :barebone: bold, italic, link, source
  • an array with one or more of the following symbols: :bold, :italic, :underline, :ul, :ol, :outdent, :indent, :link, :image, :video, :source

:blocks

  • :all: all the available blocks;
  • :basic: just h3, h4, h5, p (default);
  • :barebone: just p (default);
  • an array with one or more of the following symbols: :h1, :h2, :h3, :h4, :h5, :h6, :p

:height

  • :tiny: 70px;
  • :small: 90px;
  • :medium: 170px (default);
  • :large: 350px;
  • :huge: 450px;
  • an integer representing the height of the editor;

activeadmin-wysihtml5's People

Contributors

chenzeyu avatar jklimke avatar kimlima avatar louman avatar mzampetti avatar nebirhos avatar st0012 avatar stefanoverna avatar tomeduarte avatar tommyblue avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

activeadmin-wysihtml5's Issues

Bad positionning with latest ActiveAdmin

Hello

I use ActiveAdmin on the master branch with Rails 4.1 and the Wysihtml5 editor is not well positionned
capture decran 2014-04-23 a 11 10 36

Something like this would fix it

body.active_admin form .activeadmin-wysihtml5 {
  float: left;
  width: 70%;
}

Best regards

Geoffroy

How to configure S3 Storage in ActiveAdmin Form

I saw this issue #10 here already, although some of the links are broken and it seems things have changed since then. How do we configure the S3 in the Formtastic mark-up for the editor? Is there a separate config I'm a missing.

Here is my current form code:

form do |f|

    #Debugging
    f.semantic_errors *f.object.errors.keys

    f.inputs "Details" do
      f.input :title, :required => true     
      f.input :short_description, :hint => "Shot description for the event that will be displayed as a thumbnail", :required => true
      f.input :description, as: :wysihtml5
      f.input :event_date
      f.input :published, :label => "Published"
      f.input :type, :required => true
      f.input :category, :required => true
    end

    f.actions
  end

Model names conflict

I have conflicts with current model "assets" because i already have such table. I think it is a good idea to use prefix for table name like 'wysihtml5' or other

Problema con activeadmin-globalize3

Usando entrambe le gemme, quando carico la pagina di edit ho un errore in /assets/activeadmin-wysihtml5/base.js riga 2976

TypeError: sel.nativeSelection is null

e nei tab diversi dal primo (ovvero quelli non inizialmente attivi) vengono duplicate le textarea in cui è attivo wysihtml5 ma il wysiwyg funziona solo nella seconda delle due (entrambe hanno lo stesso contenuto)

Sass error

Undefined mixin 'box-shadow'.
(in /Users/maxschulze/.rvm/gems/ruby-2.1.0/bundler/gems/activeadmin-wysihtml5-c499bc7ee00b/app/assets/stylesheets/activeadmin-wysihtml5/base.css.sass:22)

Strong Parameters -> Asset upload error

Hi,

Thank You for this great gem! I am trying to implement it into one of my current projects ,but I have some small (or maybe not so small) bugs to report.

The gem created an Assets menu in ActiveAdmin which is great, but when I try to add an asset I get a Forbiddenattributes error. I guess this is because I use the strong parameters gem. I tried to create an assets.rb file in the admin folder to configure strong parameters, but it doesn't seem to work.

This is my Assets.rb file:
"ActiveAdmin.register Assets do

controller do 

    def new
      @asset = Asset.new
    end

    def create
      @asset = Asset.new(asset_params)
      @asset.save
      render active_admin_template('index.html.arb'), :layout => false
    end

    def show
      @asset = Asset.find_by_permalink(params[:id])
    end

      def edit
        @asset = Asset.find_by_permalink(params[:id])
      end

      def update
        @asset = Asset.find_by_permalink(params[:id])
        @asset.update_attributes(asset_params)
      render active_admin_template('edit.html.arb'), :layout => false
      end

    def destroy
      @asset = Asset.find_by_permalink(params[:id])
      @asset.destroy
      render active_admin_template('index.html.arb'), :layout => false
    end

      def asset_params
        asset_params = params.require(:asset).permit(:asset,:storage,:retained_storage,:storage_url)
      end

end

end "

The above approach works on other content assets.
Any idea why it doesn't with assets?

Customization of the js

I'm trying to add classes to the blocks, to be able to have a <p class="question"></p>, found the js to do so, but I can't find where to initialize it in ActiveAdmin.

Error returning assets as json.

Hi!

Maybe this is not an issue from the gem but I'd like your help cause I have been struggling with it some hours.

I'm using the gem on my activeadmin. It works perfectly when locally. When I click the Image button, the lightbox opens and a request to assets.json is made and assets are loaded o screen.

When I deploy my app on heroku, this is not working and I get the following error:
image

But, and I try to upload a new assets, it works:
image

Any idea?

Thanks,
Paulo

Custom classes not persisting

When I add a class to a tag using the HTML view (e.g. p class="lead") and save, it applies the styling. But if I go back in to edit the file again, the custom class is automatically removed.

Image modal window size/position problem

The other bug I have is when I am at the editor and click on the Image button which opens a pop-up. I currently have 5 assets and when I go the gallery section in the pop-up they push the insert button out of the view so I can't click on it.
I can attach an image if You want.

Rangy is not up to date

I get this warning:

'Range.detach' is now a no-op, as per DOM (http://dom.spec.whatwg.org/#dom-range-detach). wysihtml5.min.js?body=1:176

In some browsers there is just the html view.
Could not update rangy (https://github.com/timdown/rangy) because log4javascript is not supported.

Any idea?
Thanks

Able to change text color

I'm wondering if there's a way to change text color in editor?

Seems that adding styles/class to elements does not work.

Could not find gem?

Hi. I seem to have some issues with installing this gem.

Added gem 'activeadmin-wysihtml5' to my gemfile and did a bundle install, get the message;

Could not find gem 'activeadmin-wysihtml5 (>= 0) ruby' in the gems available on this machine.

Then i tried adding the gem from this github repo which resulted in the following;

Could not find gem 'activeadmin-dragonfly (>= 0) ruby', which is required by gem 'activeadmin-wysihtml5 (>= 0) ruby', in any of the sources.

Am i doing anything wrong?
Cheers!

Edit: fixed it by adding dragonfly through git as well.

Edit 2: did not really fix it because now it get this :).

rake active_admin_editor:install:migrations
rake aborted!
Don't know how to build task 'active_admin_editor:install:migrations'
/home/johan/.rvm/gems/ruby-1.9.3-p327@rails329/bin/ruby_noexec_wrapper:14:in `eval'
/home/johan/.rvm/gems/ruby-1.9.3-p327@rails329/bin/ruby_noexec_wrapper:14:in `<main>'
(See full trace by running task with --trace)

S3 Storage

How can i set s3 storage for this gem?

Thanks

How can i overwrite parse rule js?

now it impossible,cause

https://github.com/unmantained-activeadmin-plugins/activeadmin-wysihtml5/blob/master/app/assets/javascripts/activeadmin-wysihtml5/base.js.coffee#L2

https://github.com/unmantained-activeadmin-plugins/activeadmin-wysihtml5/blob/master/lib/active_admin/wysihtml5/rails/engine.rb#L18

can we split js and include rules manually?

Use Paperclip

Is there an option to use paperclip with your rather ace editor? I already have that setup elsewhere in my site, seems a shame to install & configure a second attachment gem.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.