Open darksnake747 opened 6 years ago
CoffeeScript isn't anybody's strong suit.
A new ContentEdit type is probably necessary to accommodate an official 'hr' tool. That's way beyond the scope of the documentation. Adding ContentEdit types pretty much requires deep-diving into the entire source code (all 20,000+ lines of it with ContentEdit being the least commented code and hanging around 16,000 lines long).
Emoticons/smilies are better implemented via standard emoji. Desktop can copy-paste the Unicode characters from Emojipedia. Mobile/tablet devices have their built-in emoji keyboards.
My understanding of the code is that divs would be very difficult to implement (especially when allowing layered divs). Drag-and-drop would be complicated to get right. ContentTools is mostly flat DOM. Lists and tables are the deepest that ContentTools goes and they have their issues. As an alternate solution, you could use, for example, an unordered list with a custom class to wrap your content and then a tool like TagFilter to transform lists containing that class into div-wrapped paragraphs when emitting the content to the final page. There are other similar approaches. Now that I'm thinking about it, TagFilter could also be used on an existing tag with a special class called 'hr' to transform the tag into a hr
tag (or simply prepend a hr
tag to the current tag being processed).
@cubiclesoft CoffeeScript is very my strong suit, however you'll be happy to hear I intend a complete rewrite of ContentTools in 2019 (ContentTools2) at which point I'll be moving to ES6 and dropping support for browsers that don't support it.
I've always been hesitant to move to ES6 previously because of replacing one transpiler for another, but the landscape is different now and being able to remove a transpiler from the equation is a big enough benefit for me to concede and move things to ES6 as well as updating the build process (I was naive when I implement CT the first time around and didn't get this aspect right at all).
@darksnake747
With regard to HR's, you could implement these fairly easily but as @cubiclesoft suggests you'd need to immerse yourself in the ContentEdit code, however there's a much simpler solution, you can make any static element (an element not recognised by the ContentEdit as a native editable element) movable as follows:
<hr data-ce-moveable>
This is why there isn't a native HR element to be honest, because on the rare occasions we've implemented them we do this instead. You will need to create a tool that allows you to insert a HR element, but this wouldn't be difficult to do and there's a tutorial covering tool creation here: http://getcontenttools.com/tutorials/adding-new-tools
However if you get stuck I'm happy to help you with this :)
With regard to Emoticons I think @cubiclesoft suggestion here is a good one however if you require icon support I wrote a tool for this recently for a client and I've just gotten permission to share that source, the source code is here: https://git.getme.co.uk/intellective/intellective/tree/master
This includes a number of other tools including a font selector, and headings menu. Hopefully this is of some use.
With regards to divs This is already possible using content flows, but this is a relatively new (and very much undocumented feature). Here's an example of content flows in action https://www.youtube.com/watch?v=6PuBjyWXCyM
As @cubiclesoft this isn't a feature of ContentTools and whilst other developers have implemented similar div behaviour it's a significant project. ContentFlow provides a base for developing your own block level editor where each block is managed separately for layout but are combined when the page is edited using ContentTools.
Right now my free time focus is mostly on a new framework/CMS called manhattan which makes heavy use of ContentTools and ContentFlow. I will be supporting CT this year, but new feature development will mostly be focused around ContentFlow and manhattan, and then this will change again in the following year as I focus on moving projects across to ES6.
I intend to do a bit of a write up on my journal about my plans for 2018 in the next few days, I'll post a link here as soon as I do.
@cubiclesoft I get requests for CT commissioned work every so often (once a month or so), I'm so busy at the moment with various projects that I'm working on that I often have to turn these down.
As someone with significant knowledge od CT if you're ever interested in me passing these on with my recommendation let me know where to reach you and I'll happily do so.
@anthonyjb thank you very much for the reply and so much information. I really appreciate you sharing your thoughts and these details. I am using CT in a larger project of mine to simply allow minor edits to select page content. It is a vital piece to the project as a whole, but really small in scale. CT won my vote over other RTEs that I've used (not that I consider CT a typical RTE) for a lot of reasons and the "lacking" features aren't really too lacking. I just thought if you were actively looking for thoughts on things that could be added, I'd love to see some things... but with them missing, it's not big deal - for now at least. ContentFlow seems like it could be a pretty nice additional toolset, so maybe I'll look into that some. And the data-ce-movable is a great pointer, I must have missed that or something because I don't remember seeing it when I was making my mods and definitely would have solved some problems I was having.
That said, honestly, given my current work load and timeline, I'm probably just going to leave things as they are for now. Perhaps after I get things moving better, I can dive in and make some mods of my own, but until then, I can certainly make due with it as is.
I will however be looking at the icon code... mostly because I am curious. Thanks again!
I also want to thank you, @cubiclesoft, for your input on this. I did have to take some time to really dig into the code when I started my mods and had gotten comfortable enough to be dangerous pretty quickly. But, I want to be efficient and skilled, not dangerous; that would have taken a lot more time. I'll be looking at the TagFilter project as well to see if it is anything I could make use of given my current situation. Thanks again!
I was wondering if there is a planned feature list anywhere; I have a number of ideas and have considered forking this myself, but coffee isn't my strong suit and if there is a chance we'll see these features come out soon anyway, it wouldn't be the most efficient thing for me to do. That said, are you open to requested features? Is there a better place to submit those... and maybe even these type of questions? I've also noticed a lot of conversations here mention "things already having been done by others" and wondered if there was an official place to look for plug-ins and such.
Just a few features I'd love to see is the ability to insert the following:
I did actually start building my own tools using the "Adding new tools" tutorial and was having some success, but time got the best of me and I was running into a number of issues getting things to work correctly.
Again, not begging or demanding; nor am I trying to get you to do more than you have done or plan to do. I am just curious about these sort of features as well as your thoughts on the future of this product and the community making requests like this. Thank you very much for your time and amazing tool.