ruby on rails - Remove buttons on active_admin_editor gem -


i'm trying customize buttons on ribbon of active_admin_editor gem. according documentation, i've set on initializers/active_admin_editor.rb test it:

activeadmin::editor.configure |config|    config.parser_rules['tags']['h1'] = {     'remove' => 1   }   config.parser_rules['tags']['h2'] = {     'remove' => 1   }   config.parser_rules['tags']['h3'] = {     'remove' => 1   }   end 

but no avail. did

rm -rf tmp/cache 

as suggested on docs , restarted server several times, still change makes no effect, , h1, h2, h3 buttons still showing up. problem?

hello!

the parser bit reads input , defines if styling has been attached it, if copy , paste content html page.. , if styling applicable or not in block, right.

an other idea had first deactivate of selectors , reactivate them 1 one. think quite thing users tend copy formatted text it. here solution:

activeadmin::editor.configure |config|   config.parser_rules['tags'] = {     'remove' => 1  }   config.parser_rules['tags']['h3'] = {     'remove' => 0   }   config.parser_rules['tags']['p'] = {     'remove' => 0   } end 

but doesn't affect buttons remove chucking in little css hack:

 .toolbar a[title="bold"]{     display: none;  } 

those 2 resources might helpful:

https://github.com/xing/wysihtml5/blob/master/parser_rules/advanced.js 

and

https://github.com/ejholmes/active_admin_editor/blob/master/app/assets/javascripts/active_admin/editor/templates/toolbar.jst.ejs 

this 1 of first answers on stackoverflow, hope it's nice one. cheers!


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -