|
|
@@ -72,7 +72,7 @@ |
|
|
aiButton.addEventListener('click', function () { |
|
|
aiButton.addEventListener('click', function () { |
|
|
var prompt = window.prompt('Describe the image to generate with AI'); |
|
|
var prompt = window.prompt('Describe the image to generate with AI'); |
|
|
if (!prompt) return; |
|
|
if (!prompt) return; |
|
|
var url = 'https://gen.pollinations.ai/image/' + encodeURIComponent(prompt); |
|
|
|
|
|
|
|
|
var url = 'https://pollinations.ai/p/' + encodeURIComponent(prompt); |
|
|
var range = quill.getSelection(true) || { index: quill.getLength() }; |
|
|
var range = quill.getSelection(true) || { index: quill.getLength() }; |
|
|
quill.insertEmbed(range.index, 'image', url, Quill.sources.USER); |
|
|
quill.insertEmbed(range.index, 'image', url, Quill.sources.USER); |
|
|
quill.insertText(range.index + 1, '\n', Quill.sources.SILENT); |
|
|
quill.insertText(range.index + 1, '\n', Quill.sources.SILENT); |
|
|
|