jeffalo / scratch-image-uploader

Use Scratch project thumbnails to upload images to be used on the forums.
10 stars 3 forks source link

image url #22

Open jeffalo opened 4 years ago

jeffalo commented 4 years ago

image

BoomerScratch commented 4 years ago

So, do you mean if you, for example, paste https://user-images.githubusercontent.com/40470736/89317111-3c59de00-d67d-11ea-8947-e6ca9ef139f2.png, it will get uploaded?

jeffalo commented 4 years ago

yes, but i am still thinking of if this is a good idea...

NoobTracker commented 4 years ago

I would add an extra button for that, I think, but adding the feature that each image is converted automatically when you post could be cool, if it works, that's the question.

jeffalo commented 4 years ago

hmm that would be good, but bloating up the toolbar could be bad...

NoobTracker commented 4 years ago

I think that adding a single button isn't the worst thing in the world. (btw, what about comment and drag&drop support?)

BoomerScratch commented 4 years ago

How about an input next to the upload button where a user can type in an URL?

NoobTracker commented 4 years ago

A whole input would be pretty big ...

BoomerScratch commented 4 years ago

@NoobTracker We can make it smaller, or make it appear when another button is pressed.

NoobTracker commented 4 years ago

So you mean an <input>? I think that a small button like the current one for uploading from your PC would be better that will do what, for example, happens when you press the link button in scratch, forgot the JS command. But I think that we found enough exploits for an svg image redirect thingy, so that could be another userscript or an addition to this one.

NoobTracker commented 4 years ago

@BoomerScratch But we'll see. Maybe the svg exploit doesn't work so that could still be useful. I would still think that it wouldn't look nice if there was an input. Having 10 normal buttons and then somewhere in the middle an input is an interesting idea, but it would look kinda weird.

BoomerScratch commented 4 years ago

https://github.com/LLK/s2forums/blob/5296e5c42d0c90de466de6ec27119786ec100ec7/djangobb_forum/scratchr2_settings.py#L37 This is the regex of the whitelisted image hosts. If a whitelisted image host is pasted/entered, nothing should happen. Also https://github.com/LLK/s2forums/blob/5296e5c42d0c90de466de6ec27119786ec100ec7/djangobb_forum/scratchr2_settings.py#L40

NoobTracker commented 4 years ago

Oh yes, looking at the source code reveals the secrets. When you paste something whitelisted, it will just create the normal image without uploading, I would say.

BoomerScratch commented 4 years ago

@NoobTracker Yes

NoobTracker commented 4 years ago

Another idea: What if we just manipulate the normal image embed button so it does that? That would be a really elegant solution.

NoobTracker commented 4 years ago

It also wouldn't make using not-whitelisted stuff impossible because you could just edit the final result. Would make it a little bit harder, but just a tiny bit so who cares‽

NoobTracker commented 4 years ago

What if we make it so that using the normal image embed button will always use the thumbnail trick? It would be more reliable then, say, anything else. When the thumbnails are down, Scratch is down, so it never appears to be down since when the thumbnail doesn't load, you can't see the forums in the first place.

NoobTracker commented 4 years ago

@BoomerScratch Since you have that userscript, you probably don't use something like cubeupload and when you wanna upload something from cubeupload which is pretty unreliable (two times down for a day in only a month or so) so it's just reuploading the image to Scratch so it's "never down", as I explained.

NoobTracker commented 4 years ago

Does that make sense?

jeffalo commented 4 years ago

yeah, that seems possible... i'll look into trying to do that

NoobTracker commented 4 years ago

Great!