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
Implement Dropbox export (#82) #393
Conversation
Don't use await/async since we support old browsers, use URLSearchParams API, chromeLocal and chromeSync wrappers, find a different way to pass the parameters like messaging because redirecting location.href is weird. Find a way not to use web_accessible_resources. There are more nits I'll pick on in a few days. |
Hi @tophf, thanks for the review. I will fix the things this week and update the PR. Which are the browsers the project supports? (I'm going to update the README to help others) |
if there are any I've missed feel free to say, however my understanding is it's only chrome, Firefox and opera |
|
Hi @tophf, I dove into I tried a lot of way, but without success. Here is a URL to "test":
edit: typo |
It works with anything you feed it, but of course in this case you need to extract the hash part first: |
As for web_accessible_resource, this is really something I'd like to avoid. Look for an alternative solution e.g. chrome.identity.launchWebAuthFlow etc. |
I will try to find another way instead of web_accessible_resource ^^. I know that some addons have an open url to validate. Is there a server for Stylus? |
No, we don't have a server. |
… api and get rid of web_accessible_resources
Hello @tophf, thank you very much for the tip about If you think there is room for improvement, just tell me, please. I think would be good if the user has some feedback when the file is uploading, but I couldn't find a nice way to do that. edit: typo |
I was thinking about using the current dialog to show that it's uploading the file and then close it automatically when it's done. What do you guys think? |
Progress reporting is a good thing especially when the style database is 5MB or more. I think we'll also need a built-in gzip or zip in a pure js worker, but not necessarily in this PR. |
Yeah, I'm going to work on the progress reporting. About gzip/zip I think it's very interesting idea. I found some libs that can help:
If I'd pick one, I'd choose jszip because the api is cleaner than the others. But we can discuss it better. |
I googled about progress bar on dropbox sdk and sadly they don't have anything to track the upload (dropbox/dropbox-sdk-js#157). |
I have been known to be wrong once in awhile but you could do it the old fashioned way and get the file size on start and simply have a small routine do the math yourself. I think dropbox is wrong on one count they have to keep track of how much is uploaded or blocks sent so that might allow you to get a progress indicator. Just thinking out loud. |
Hi @DanaMW, thank you for your comment. That was what I said in my last statement about filesUploadSession* functions, maybe it wasn't clear, sorry. I don't know if it's worth to create a more complex mechanism to upload a file just for a progress bar. Maybe just a couple of messages + compression would solve the problem better. |
Hi again on my machine using tampermonkey it all happens so fast you might not even get the bar drawn before it was done lol. Nice to meet you and have fun here man you picked a good crew. |
Hello guys, finally I had some time to implement the compression and decompression of the styles for the export and also I added some messages in the process. I hope you like. |
We've started including a |
Hi @Mottie, no problem, I added it now. Thanks. |
To resolve the conflict, do you prefer rebase or merge? |
You can merge the master, we'll simply squash the PR into one commit later. |
Merge done ^^ |
Please rebase with the master... there are conflicts, so we can't just push the button 😉 |
Odd, I'm still seeing the conflicts message. |
Ops... my bad. I thought I had merged already. |
hmmm... that is weird. Let me see the commits hash from the master on github. |
Well, the last commit (e128498) is merged too. |
I'm gonna let @tophf merge this PR anyway... I didn't look at the code, I've only tested it 😉 |
Ok ^^ Thanks for testing :) you helped a lot |
I see no conflicts anymore, but yeah, better to wait for tophf to give it the green light. |
@matheusfaustino please, make the same for OneDrive! |
Hi @Kenya-West , I'll look into the documentation to see how hard is to implement OneDrive, I personally don't use it, but if it's not that hard, why not? |
I think, OneDrive API is included in Microsoft Graph API, see graph.microsoft.com or dev.onedrive.com. I personally didn't work with Microsoft Graph, but I know, that Microsoft Graph is supporting both v1 and v2 versions. v1 has more APIs specific for Personal accounts and Work accounts, while v2 unifies Personal and Work accounts and offers single API queries, no matter business, school or personal subscription user is on. Despite v2 has a bit less functionality, it is very common action to upload and download files from/to specific folder in OneDrive, so this API method should exist in v2. I suggest you to look at Tampermonkey's source code if possible. and probably Office Online add-on. I will also investigate deep into this, but with no guarantees - I don't have experience in developing browser extensions (but I developed some Angular components just for run). |
Hi @tophf , how are you? I hope you're doing well. Do you need something else from me? bye glhf |
@matheusfaustino commented on 1 oct. 2018 à 08:34 UTC−4:
I really hope it will be merged soon 😄 |
I got tired so in the foreseeable time span I'm not working on Stylus except maybe on some trivial occasional stuff like CSSLint/parserlib. Mottie will handle the PR, I think. |
Yeah, I'll take care of it soon... I've been busy with work. |
Hello, don't worry. I don't want to give trouble, it's just to know which step we are ^^ if you need something, please ping me :) |
@matheusfaustino Are you working on this again right now? |
@narcolepticinsomniac I'm about to work on it. Actually, I'm testing the integration with OneDrive. |
In the future, just give me a heads up on Discord or here if you're gonna log in to the account. I got a security alert, and you didn't respond to the ping, so I changed the password. I can DM you the new one if you need it. |
I'm sorry, I took the liberty of doing that, my bad. Ok, if I need it, I ping you. thanks ^^ |
It's all good. Mottie's got it too if I'm not around. |
@matheusfaustino Check Discord. |
I'm working on the issue now... essentially, Dropbox has locked our app because we never applied to put our Dropbox app into "production" after we reached 50 users. I'm filling out the form now. |
Hi @narcolepticinsomniac sorry I had some problems this weekend. I going to download the discord app to be in touch ^^ |
Hello guys,
First of all, thank you for your work and for this addon. I'm sending my initial implementation of a Dropbox integration, related to the issue #82, to see if you guys are interested in this feature, if it's following the coding standards of the project and if I have to change something in the implementation.
After this one, I'll work on the Google Drive integration, so I will use it as an experiment to the Google Drive integration.
Thanks for your time.
Best,
EDIT:
Ow, you have to create an app in dropbox and get the app key to test the implementation