Tips: How unofficially enable imgur drag and drop support
Requirement: Working imgur button.
Requirement2: If you want enable too for copy and paste image, require Rin Editor 1.0.8 or above.
Caution: This is unofficial modification. I will not support issues related with this.
PS: This only will work in wysiwyg mode
What does it do: The editor in WYSIWYG mode means in visual mode, it will automatically upload the image for imgur in the following cases:
- drag and drop (drag and drop the image into the editor)
- Copy and paste MS Word images (in this case it doesn't matter how many images or if you selected the text or not)
The feature below require Rin Editor 1.0.8 or above and you must enable Unofficial support for base64 images: (
https://community.mybb.com/thread-189422...pid1359753)
- copy the image from any website and paste it in the editor (you should just copy an image (right button on top of the image and select copy the image in the case of FF), if you select the image and text this will not work)
Caution: This feature uses base64 images (
https://github.com/ckeditor/ckeditor4/bl...s#L96-L100), it means that all images that you will insert or converted by ckeditor to this format will uploaded to the imgur. So when you activate this, you are unable to use images in base64.
Steps:
1 - Download the following package:
For Rin Editor 1.1.1 or above
https://github.com/martec/imgur_drag_and.../0.0.2-new
For Rin Editor 1.1.0 or below
https://github.com/martec/imgur_drag_and.../tag/0.0.1
2 - Extract No. 1 to: root/jscripts/rin/editor/plugins
3 - Open and edit root/jscripts/rin/editor/config.js
Find:
config.language = rinlanguage;
add above:
For Rin Editor 1.1.1 or above
config.extraPlugins = 'filetools,imgur_drag,notificationaggregator,uploadimage,uploadwidget';
For Rin Editor 1.1.0 or below
config.extraPlugins = 'filetools,imgur_drag,lineutils,notificationaggregator,uploadimage,uploadwidget,widget,widgetselection';
Find:
config.image_previewText = ' ';
Add below:
config.imageUploadUrl = 'https://api.imgur.com/3/image';
4 - Clear your browser's cache, if you're using cloudflare, you also need to clear your cloudflare cache (
https://support.cloudflare.com/hc/en-us/...Cloudflare).
it's all.
(2020-12-23, 11:09 PM)Omar G. Wrote: [ -> ]Hi, I did a basic replace of files (no uninstall, no deactivate, etc) and it seems to fix the issue. I don't know if it causes other issues though, I would assume it doesn't at this moment.
I'm glad it worked. could you tell me which browser and operating system you use to comment on this part of the code?
(2020-12-23, 11:09 PM)Omar G. Wrote: [ -> ]As a suggestion, getting templates, settings, and even template variables removed on minimal updates is very unfriendly. I would suggest to consider something like PluginLibrary to manage settings and templates, or something own-coded.
Regards, keep it up.
sorry i was copying and pasting the update method for my convenience.
usually replacing the files and making the following changes is enough.
Open and edit:
Home » Template Sets » Global Templates » Edit Template: rinbutquick
Find:
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/rin/editor/rineditor.js?ver=x.x.x"></script>
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/rin/editor/ckeditor.js?ver=x.x.x"></script>
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/rin/editor/adapters/jquery.js?ver=x.x.x"></script>
Replace x.x.x with new version number.
In the next version I will better guide this part.
(2020-12-23, 11:09 PM)Omar G. Wrote: [ -> ]Edit: It seems your last update included the fix you attached. I did test the attached package but not the update in the Extend site.
it's same. But only version number is different to differentiate from the official version from unofficial.