Closed gouthambs closed 7 years ago
好顶赞。 如果能增加对于上传图片的支持,那真是好极了。
The callback function for name: 'cmdImage'
shows a prompt. Instead we could create a bootstrap panel or bootbox with ability to accept image hyperlink or a file select option with an attached action to perform file upload on the server side.
take a look at this demo: http://embed.plnkr.co/atyuBnVNktl8YSfdfPJT/preview it has custom code for uploading image like this comment box in github :)
@lodev09 This is awesome! Is there any interest to incorporate this by default?
I created that demo using another plugin for uploading so I'm not sure. Maybe @toopay can decide
There is an issue regarding the usage of native browser prompt dialog at #177 So i guess bootstrap dialog would be proper solution in the future.
@lodev09 if you have time to tighten your code for upload, we may could use it. Please make a branch if you decide to do so, i'll happy to review it.
I can start working on this (i need it). I'm thinking on using this http://www.dropzonejs.com/ so there is no need to "reinvent the wheel"
@toopay what do u think?
@jacargentina be my guest. We can continue the discussion in your PR.
Just found this repo and its really cool. Like the idea of a image handling found this also http://benfoster.io/blog/pagedown-markdown-editor-custom-image-dialog
might help in not reinventing the wheel. It might have some ideas. Really liked the simplicity of that demo
Hey, anybody want to look at my PR? Any suggestion is welcome
@lodev09 HI, when i use http://embed.plnkr.co/atyuBnVNktl8YSfdfPJT/preview , always failed with
Error
uploading filename
- Bad Request
i hava changed the url: "static-uploads.php",
to my post uri and the uploadFinished: function(i, file, response, time)
response .
can u help me ? thank you.
Try to print_r($_FILES);
if you're on PHP inside your post url see if it's sending something. Also, one way to debug is through chrome dev tools (F12) and inspect the data sent through the network tab.
Hope that helps :)
Hi @jacargentina and @toopay , could you please share some information on how do you insert the uploaded image to the CURSOR position inside text area?
@brxue check the plugin's source code.. you'll find code example in there to manipulate content by cursor position. Also, $textarea property is available for you to manipulate the content and insert your custom text.
It's probably time to close this thread :)
Currently the image support is only for URLs. It would be nice to have an upload capability as well to do file upload, and use that URL in the image.