Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

complete callback #66

Open
dy opened this issue Aug 3, 2016 · 4 comments
Open

complete callback #66

dy opened this issue Aug 3, 2016 · 4 comments

Comments

@dy
Copy link

dy commented Aug 3, 2016

Hi @christiangenco!

We’re using dbinbox (basic plan) iframe for one of our projects and we want to add some notification and tracking if a file transfer is completed or at least the file is added to the queue by user.
For now embedded iframe has no any sort of messaging, though in console there is an object being logged when a file is sent, but that happens within the iframe.
Is it possible to add simple postMessage mechanism to notify about simple events like add, send, progress, complete?
Is there any sense in making a PR for that?

Thanks.

@christiangenco
Copy link
Owner

Ooo, this is a good idea. To be clear: do you want this callback in javascript?

The codebase in github has diverged a lot from that actually deployed at http://dbinbox.com so a pull request would be tricky. What would be helpful on my end is if you wrote up what your ideal code would look like on your end for handling the callback, and I'll fiddle with things on my end to get that to work.

@dy
Copy link
Author

dy commented Aug 4, 2016

Yes, exactly, a javascript callback.
What I expect — in main index.html, where I include iframe, I do:

window.addEventListener('message', function (event) {
    if (event.origin !== 'https://dbinbox.com') return;
    if (event.data === 'add') console.log('file added');
    if (event.data === 'complete') console.log('file sent');
    event.source.postMessage('thanks, lad!', event.origin);
}, false);

Basically the behaviour from here.

@christiangenco
Copy link
Owner

Okay cool, I can do something like that. I'll send you an email when it's
ready!

Christian.

On Thu, Aug 4, 2016 at 5:44 PM, Dima Yv [email protected] wrote:

Yes, exactly, a javascript callback.
What I expect — in main index.html, where I include iframe, I do:

window.addEventListener('message',function(event) {
if(event.origin !== 'https://dbinbox.com') return;
if (event.data === 'add') console.log('file added');
if (event.data === 'complete') console.log('file sent');
event.source.postMessage('thanks, lad!', event.origin);
},false);

Basically the behaviour from here
http://stackoverflow.com/a/8849807/1052640.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#66 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAK8oV9D2LGzPWPf6TTcWe0yTYCJMUChks5qcmtCgaJpZM4Jb6Y1
.

@dy
Copy link
Author

dy commented Aug 15, 2016

Great, thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants