A plugin for summernote editor to allow user to add custom css classes (custom styling) to the selected elements
Live demo (check the CSS3 icon button)
license: MIT
accepting tips at https://www.paypal.me/creativedotit
A plugin for summernote editor to allow user to add custom css classes (custom styling) to the selected elements
License: MIT License
A plugin for summernote editor to allow user to add custom css classes (custom styling) to the selected elements
Live demo (check the CSS3 icon button)
license: MIT
accepting tips at https://www.paypal.me/creativedotit
It works great but when i only use plugin features without typing content or use built in Summernote functions the code in hidden textarea won't update.
If you have another node on your page highlighted or has focus outside of the Summernote editor, it will still apply the class to the element, which is not desired.
Just an FYI for anyone in the future, I was able to fix this issue by replacing this line:
$node = $(document.getSelection().focusNode.parentElement, ".note-editable");
with this:
$node = $(".note-editable").find(document.getSelection().focusNode.parentElement);
Love this plugin though! Exactly what I was looking for!
Issue: Summernote not saving applied classes added via this plugin.
Resolution:
After much trial and error I appended the line
context.invoke('triggerEvent', 'change');
to the click
function of the addclass
plugin within the summernote-ext-addclass.js file.
This (seems to) resolve the issue where summernote does not recognize any additional class styling that is added if you do not trigger the summernote.change
event after applying your classes (i.e. by typing other content after applying classes).
Probably should be added to the master branch but I haven't done enough testing on it to create a PR. If not then hopefully this saves someone else time to figure out.
Ahoy Stefano,
I clicked on the link in your bio, it appears your domain has been squatted and defaced.
BR //
Hello, i am using your plugin for the first time and it is great! however i would like an option so that when i press enter, the class is removed, for example i put something in an alert and when i press enter it creates a new alert, i think it should jump to the next line but without class.
Another problem is that say i select the class alert-info, then if i choose alert-danger it just gets added to the list of classes, so it doesnt switch, it just adds the two classes together. I think it would be better to remove all classes before adding the new one so that you can switch without issue between two classes.
Also, would it be possible to remove the class with the remove style button? and on that note do you think it is possible to add the classes to the style button so as to have a unified style button?
Thanks for the great work!
I am using Firefox 66.0.5, Win 64bit, XAMPP, Summernote 0.8.9.
My console log says "unreachable code after return statement', but it works (tested with jumbotron etc). I even add my own class. Is it something to worry about ?
I tried your demo/jsfiddle, and it shows styled elements, but I could not change them. Has an update to summernote done something with the capabilities of this plugin?
Just want to say thank you for this ! :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.