IRC Log Viewer » #firebreath » 2012-05-22

IRC Nick Time (GMT-7) Message
niftylettuce 10:05 taxilian: hopefully you can help... so b/c of security you can't change file source on a <input type="file"> --- now I have a few options here, I can do some server side stuff, I can do some client side stuff, or Im thinking I can use an NPAPI mini plugin to achieve this -- do you have any thoughts? I want to emulate the drag and drop of a local file with a client side file created in the brows
er using FileEntry/File/Blob API's
taxilian 10:05 niftylettuce: I dont' understand what you're trying to do
niftylettuce 10:05 taxilian: simulate local file upload in Gmail in Chrome
and then you can add like <div id="downloadElement" draggable="true">Drag Me</div> to the DOM
so when you drag it over the normal drag and drop Gmail area for attachments, it should upload it
but it doesnt work
so you obviously can't touch <input type="file"> since that is readonly
it's not a problem to use NPAPI plugin, I just don't know the steps needed to achieve that desired functionality with it
taxilian 10:05 what do you mean by simulate local file upload?
you mean this isn't a local file upload but you want it to look like one?
what are you actually trying to accomplish?
niftylettuce 10:05 I'm trying to create a file client-side in the browser in Gmail, then drag and drop it to the dropzone that Gmail already has
so I can upload client-side attachments in Gmail
vs. having to select from local computer
taxilian 10:05 I don't know how you'd do that in a normal app, much less in a plugin
if it's possible it will involve lower level OS features; you'd need to somehow tap into the drag/drop functionality of the OS. Hypothetically if you can control what is being dragged it may work wherever you drop it; I have never dealt with drag/drop at that level
I can tell you it's almost certainly going to be completely different on any OS that you support
niftylettuce 10:05 yeah, I was thinking of manipulating the FileList element, but that is readonly, however I don't think it is readonly for drag and drop client side
there _has_ to be a way!
taxilian 10:05 you aren't going to be any ways to do it through NPAPI
niftylettuce 10:05 why is that?
taxilian 10:05 because there isn't anything built in directly and you can't do it through javascript
jshanab 16:05 I wanted a mouse scroll input and found it was easy to add to pluginwindowwin.cpp
However, it could confuse people unless we also manage mouse over focus because focus in windows follows click and not hover. So once I have clicked on my pluging display area the focus is on it and so the scrool zoomz, but the browser scroll appears broken until I click off the plugin.
taxilian 16:05 hmm. interesting
jshanab 16:05 I was thinking maybe this is why why it was not implemented :) ?
Oh, i did not know what to do with the fact that windows considers it a "Z" axis control, there is no dx and dy so I put the value in both
taxilian 16:05 err, yeah, that's totally why. *ahem*
nothing to do with laziness
jshanab 17:05 We will play with it some more here and see how it works out
Styles 20:05 What license is this under?
taxilian 20:05 FireBreath?
Styles 20:05 Yep
taxilian 20:05 it's dual licensed both LGPL and free bsd. pick whichever owrks best for you
or whichever works. works or owrks, however you prefer =]
Styles 20:05 And from my understanding this is a framework to build cross browser plugins ?
taxilian 20:05 that is correct (note: plugins, not extensions)
Styles 20:05 And it supports ... pretty much everything?
Ah plugins, humm what is the main difference?
taxilian 20:05 lol. it supports most things you can do with a browser plugin.
Styles 20:05 Damn, yeah I need extensions
I hate to ask, does anyone know a open source extension system?
taxilian 20:05 there is nothing that will work for all browsers
because they are all too different, particularly IE
Styles 20:05 Dang, thanks guys
taxilian 20:05 sorry
Styles 20:05 No problem guys
Thank you though, this is still a really cool find haha