wondercms
wondercms copied to clipboard
[Plugin improvement] Summernote editor - dropdown box with image file names
I would like to see uploaded image types in a dropdown box in summernotes "insert image" dialog.
@robiso what is the status of 'insert image' on the development branch?
Looking back, it seems it was removed, but I still see the options listed in the js file.
Would there be a way of bringing that option back, but editing the dialog that comes up upon selection? Or would this require a fork? Was having a bit of trouble following where our summernote was in relation to the origin.
@notcarbide, the "insert image" is there, but it only allows the user to enter the URL of an image (that can be fetched from Settings -> Files (right click and copy image URL).
As you noticed, we used to have a list of the already uploaded. The files fetching functionality (developed by an open source contributor) contained a vulnerability, which I was unable to fix properly.
Thus, that functionality was removed upon contacting the developer with no response received. I wouldn't mind this being implemented properly, though.
Would there be a way of bringing that option back, but editing the dialog that comes up upon selection?
I'm not sure I understand completely, can you re-phrase the question please? Here's the link to the first repo the open source dev first provided with the Summernote editor: https://github.com/prakai/wcms-summernote
Ah, okay. My current test build generated from the devFixes branch (using the builder) doesn't seem to have the "insert image" button at all. That's why the question was confusing lol.
I wonder if fixing the latest issue I made would solve that. Since it's the only difference in deploying a build vs cloning the project, as far as I know. I can see about trying the latter and verify later today.
Good catch, this was already fixed in 2.7.0 but didn't apply it to the devFixes yet. It's now been pushed to the devFixes branch with the following commit: https://github.com/robiso/wondercms/commit/48f79e9c196d6f68bf5ebb79bc64a9bb34853798
I can now successfully see the "insert image" and similar functionality in the toolbar. Let me know how it worked for you.
Edit: this commit is not to be confused with the old used file.php which enabled anyone to list all the files on your server.
I have tried to update the original file.php
so it is atleast save for exposure to the outside world.
A (draft) pull request with more info is here: robiso/summernote-editor#3
Standalone summernote editor has missing ordered list functionality. In air version ordered lists present
@RarogCmex Summernote has been updated to include the ordered/unordered list functionality. Update to 3.0.9 to see them.
Thanks for the heads up.
@robiso That's strange, I'll succesfully updated to 3.0.9 but still does not have ordered list functionality. Are you sure all's ok? I've tried to remove, then reinstall but that's has no effect
@RarogCmex, just updated it myself to 3.0.9 and the additional icons are there. Please make sure to clear your cache, as the .js file was updated (had to clear it myself).
To verify, you can open the admin.js file in the Summernote plugin folder to verify the paragraph section is there ['para', ['ul', 'ol', 'paragraph']]
.
You can try opening it via example.com/plugins/summernote-editor/js/admin.js and if it's not updated, re-check it via SSH/FTP to see the uncached state of the file
Even stranger :) I've checked that file updated successfully, but still don't see icons.
Where I should clear cache?
@RarogCmex, did you check the file via the browser or via SSH?
Via ssh.
First, just try to visit your website and login in your browser private mode to see if it's an actual caching issue.
To clear your cache: On Firefox (https://support.mozilla.org/en-US/kb/clear-cookies-and-site-data-firefox)
- Click the menu button Fx57Menu and select Preferences.
- Select the Privacy & Security panel and go to the Cookies and Site Data section.
- Click the Clear Data… button. The Clear Data dialog will appear.
- Check just the cached Web Content (to remove stored images, scripts and other cached content) should both be check marked.
- Click Clear.
On Chrome (https://support.google.com/accounts/answer/32050?co=GENIE.Platform%3DDesktop&hl=en)
- On your computer, open Chrome.
- At the top right, click More.
- Click More tools.
- Next to "Cookies and other site data" and "Cached images and files," check the boxes.
- Click Clear data.
@robiso Thanks, solved :) Sometimes I'll learn Haskell enought to write my own replacement for that editor. But that's not been this time yet.
@RarogCmex, even though a replacement can work, caching issues are something you might run into often if your server is behind a CDN/caching system or something like CloudFlare.
Also, glad clearing the cache made it work as expected, no problem at all.
@StephanStanisic I believe you were working on this a while ago? Is there any chance it could be included (I honestly forgot what the state of that feature was).
Yes, it should be working but further testing of the fix is required before we put it online. We should also either bundle jQuery + bootstrap + font awesome with the plugin since they aren't available in all themes (eg. watercolor). Or maybe pick a new editor that doesn't have bootstrap as a dependency.
The repo is here: https://github.com/StephanStanisic/summernote-editor
This feature is one of the few ones I miss from the fantastic WonderCMS. It would be very practical to have. Can I help with testing it somehow?
The current state of the plugin should be working in this pull request: https://github.com/robiso/summernote-editor/pull/3
It is currently waiting for a security checkup by someone, I'll see if I can do that next week.
It would be awesome if you could test out the updated version! A lot of things have changed in core since the pull request, so I am guessing some things are broken.
Nice! I'll help. Should I test it now or after you have got the security checkup? Also, I have only checked out ordinary repos before, how would I go about getting the repo with the pull request added?
If you look at the pull request, I'm asking to merge StephanStanisic:master
into robiso:master
. You can click on StephanStanisic:master
to go to the repo I'm trying to merge, StephanStanisic/summernote-editor
I'll do the checkup this week when I have time, but I'm pretty sure some things will be broken since it was quite some time ago we've worked on this.
Thanks! I installed it manually, removing the existing plugin and extracting the current files from StephanStanisic/summernote-editor from April 7, but I see no difference. Adding an image still only shows the "URL of image or document" field. Perhaps I did something wrong. The summernote editor plugin says "Installed version: 3.0.7" but I can update to 3.0.9. Weird thing is that now Summernote editor is listed twice in my Plugins-section even though I deleted the previously installed version first. The second copy can not be updated however. Sorry if I'm just confusing you, I might not be the best person to do this testing, but I really do want to help. :)
Ok, I think I got the correct one installed now! You can disregard the last post.
Now it's obvious things aren't working though. For one the background and some of the graphics are missing (see here
It is also almost impossible to click the buttons because the whole editor section keeps resizing, cycling through three size steps, when hovering over the buttons with the cursor.
Ah, I see that there are new changes on robiso:master, ill merge them into the pull request. That will probably fix this issue.
@StephanStanisic bumping this, can you please ping me when it's ready to be run for a test?
Adding a note here, from OneLaptopMan from community:
Yeah, Summernote integration would be great, in fact having the whole process (drag image -> auto uploads -> auto embed -> set alt text) would be great too. I'm just thinking of the easiest way my clients could populate a gallery without having a monstrous amount of base64 code filling the JSON file and having an actual file with useful meta data src set and all that good stuff available.