csga5000 / tinymce-prevent-delete Goto Github PK
View Code? Open in Web Editor NEWThis is meant to work with tinymce's noneditable plugin and will prevent the deletion of non-editable elements
License: GNU Affero General Public License v3.0
This is meant to work with tinymce's noneditable plugin and will prevent the deletion of non-editable elements
License: GNU Affero General Public License v3.0
also
return [8, 9, 13, 46].contains(c)
code, throws exception for me (i am using more plugins)
Thanks for this plugin! Save me time in my project.
I noticed a bug. Say I have a paragraph and inside the paragraph, I have a mceNonEditable span at the end. With the current code, if you put the cursor at the very end fo the paragraph, it won't let you press enter to start a new paragraph, even though this wouldn't affect the span.
I believe this is caused by this.check code. It calls this.checkChildren to see if any children have mceNonEditable. The problem is, this is reversed logic. It makes the p element return as mceNonEditable just because it has an inline span that is mceNonEditable as a child.
TinyMCE doesn't support nesting editable components so at whatever element you set mceNonEditable on, all children are non-editable. The code should therefore check parents, that way if say a element was inside the it would still prevent a delete.
First of all, thank you very much to publish this plugin so we all can use it. I would like to know, in a scale from 1 to 10, how stable do you think this plugin is today for production use?
thanks :-)
Fernando
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.