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

Import / Export #2

Open
Ryuno-Ki opened this issue Mar 16, 2019 · 17 comments
Open

Import / Export #2

Ryuno-Ki opened this issue Mar 16, 2019 · 17 comments

Comments

@Ryuno-Ki
Copy link

Today, I had the idea to embed the todo.txt generated with Simpletask with my Firefox web browser on my laptop.

Sure, it wouldn't be synced, but this way I could have access to it in contexts, where I don't want to always switch context.

Describe the solution you'd like
It would be helpful to have an Import / Export feature of the todo.txt. I can take care for the sync (and conflict resolution) myself.

Describe alternatives you've considered
Developing an own extension for Firefox :-)

Additional context
I'd like to contribute to this repository if you are fine with it. But you don't have a LICENSE.txt, so I cannot from a legal point of view.

@dthigpen
Copy link
Owner

Importing and exporting is a great idea. I think a simple File import/export would be a good first implementation. As for cloud services, I use Simpletask on my Android as well and considered the sync with Dropbox option but ran into a few API issues when attempting to implement it directly into the extension.

Thank you for bringing up the license I will add that immediately.

dthigpen added a commit that referenced this issue Mar 19, 2019
Suggested by issue #2
@Ryuno-Ki
Copy link
Author

I mean, even a <textarea> could work if you don't have permissions for the FileReader API...

@Ryuno-Ki
Copy link
Author

For me it would be a sync with NextCloud.
Maybe we can come up with a common interface and implement it for different providers?

@dthigpen
Copy link
Owner

dthigpen commented Mar 19, 2019

For me it would be a sync with NextCloud.
Maybe we can come up with a common interface and implement it for different providers?

That would be the way to go, something to make it easier to add providers down the road if needed.
Also, never knew something like NextCloud existed, thanks for introducing me

@gabriel-tandil
Copy link

Hello !
It would be great if you could define where on the pc save the file everything.txt and done.txt although I do not know if the firefox permissions will allow it.

Greetings
Gabriel

@Ryuno-Ki
Copy link
Author

Hi Gabriel,

I would assume, that the extension can only trigger a download dialog (but can check earliest on the weekend).

Then it's up to you, how you configured download behaviour.

What browsers are supported by this extension?
Firefox + Chrome? Opera? Edge? (No idea, just wondering)

@dthigpen
Copy link
Owner

I created a test branch with file importing and exporting behavior.

The exporting, downloading, actually doesn't require a dialog but that would be helpful for specifying location. I doubt you have your todo.txt file synced to your Downloads folder..

One potential problem I ran into was the extension's window being dismissed after the "File Upload" Window opens up, preventing it from loading in the file's contents since the script is closed. I'll look into ways to keep the extension window from auto-hiding, but if that is not possible then the extension would either have to move to a sidebar, or have file uploading on the options page.

As of now compatibility with Firefox and Chrome are the goals. Haven't done much testing in Chrome/Vivaldi but it should only be minor changes if it does not work already.

@Ryuno-Ki
Copy link
Author

Hi, @dthigpen,
sorry for the delay. I was sidetracked by #SaveYourInternet and demos we had here in Europe.
I just cloned this repository and loaded the extension via about:debugging (by picking the manifest.json).

So far I can get the download dialog to work, but clicking on the upload button does nothing.
Running Sabayon Linux here with Firefox 66.0.1.

Trying it in Chromium Version 72.0.3626.121 nothing works at all (not even saving a todo item).
Browse to chrome://extensions/ and enable developer mode to load an unpacked extension (picking the directory itself).
Opening the console, it tells me, that browser is undefined.
We could use webextension-polyfill to deal with that.

Also the right side is cut of (part of the cogwheel).

In Opera 58.0.3135.117 I browsed to opera:extensions (see https://dev.opera.com/extensions/basics/) and loaded it the same way like for Chromium. It behaves the same. But their I can see black text on dark-grey background (I'm using a darktheme).

Sorry for just reporting some issues. I'll try to reserve some time on the weekend to contribute code.

Ryuno-Ki added a commit to Ryuno-Ki/todotxt-extension that referenced this issue Mar 30, 2019
@Ryuno-Ki
Copy link
Author

@dthigpen I played around with the code today. I could not get the file upload to work.
However, if I move the fileinput + reader stuff to the todolist.js I can at least get the dialogue to open and can pick a file.
But somehow the onchange callback isn't invoked. Will investigate further, but opened a PR to allow the usage on Chromium-based browsers.

Ryuno-Ki added a commit to Ryuno-Ki/todotxt-extension that referenced this issue Mar 31, 2019
Ryuno-Ki added a commit to Ryuno-Ki/todotxt-extension that referenced this issue Apr 2, 2019
Ryuno-Ki added a commit to Ryuno-Ki/todotxt-extension that referenced this issue Apr 2, 2019
@Ryuno-Ki
Copy link
Author

Ryuno-Ki commented Apr 2, 2019

Ignore the triple references from commits above (had a force push due to inadvertently including #4).

@dthigpen Please decide between PR #5 and #6. Close the one you don't want to go for.

@dthigpen
Copy link
Owner

dthigpen commented Apr 9, 2019

@Ryuno-Ki Sorry for the inactivity I got busy with other things. I'll review them now!

@dthigpen
Copy link
Owner

dthigpen commented Apr 9, 2019

@Ryuno-Ki Great stuff, I like the sidebar one #5 a little more for the user experience, but the extension page #6 preserves compatibility so I think I'd go with that one.

@dthigpen
Copy link
Owner

dthigpen commented Apr 9, 2019

@Ryuno-Ki I am concerned why you were not able to get my implementation of the file upload (with the background process) to work in Firefox. To me this would be the ideal solution since it doesn't make the user take any more actions than necessary.
I will try to reproduce your problem, but it works fine for me in Firefox Quantum 66.0.2

@Ryuno-Ki
Copy link
Author

Ryuno-Ki commented Apr 9, 2019

Hm, using an UI would have some upsides:

  • A single element to deal with file import/export
  • Deeper analysis (e.g. for context, projects or due dates)
  • charting
    etc.

But it's your call :-)

Regarding background version:
Could you outline the exact steps? Maybe I did something different...

@Ryuno-Ki
Copy link
Author

Ryuno-Ki commented May 8, 2019

@dthigpen Ping. Any update on this?
If you would pick either PR I could continue with writing others :-)

@Ryuno-Ki
Copy link
Author

@dthigpen What is blocking this from moving forward?

@Ryuno-Ki
Copy link
Author

@dthigpen Ping :-)

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

3 participants