twcloud / tw5-dropbox

TiddlyWiki Five in the Sky for Dropbox
https://twcloud.github.io/tw5-dropbox/
32 stars 16 forks source link

Bookmarklet to open my tiddlywiki #10

Closed zaszlo closed 5 years ago

zaszlo commented 5 years ago

I can put the link https://twcloud.github.io/tw5-dropbox/?type=apps# as a bookmarklet, but it would be better if I could add a js bookmarklet that actually opens the provided file in that app folder. Anyone done it already? I tried it like this, but didn't went so easy:

javascript:(function(){
window.location.href = 'https://twcloud.github.io/tw5-dropbox/?type=apps#';
window.clickTT = function() {
  var links = document.getElementsByTag('a');
  for(var i = 0; i <= links.length; i++){
    if(links[i].getAttribute('data-twits-path') == "/mytw.html"){
     links[i].onclick();
    }
  }
}
setTimeout(window.clickTT, 3000);
})();
Arlen22 commented 5 years ago

https://twcloud.github.io/dropbox/ already supports this.

zaszlo commented 5 years ago

As I see that page comes with two buttons. After selecting it, you select the file to be loaded, and only then you get to where you wanted to get in the first place. I would like a shortcut to mytw.html when I click the bookmarklet.

Now one step is to start with https://twcloud.github.io/dropbox/?type=apps and another would be to make the page go further by performing the click on the link "mytw.html". This what I'm after.

Arlen22 commented 5 years ago

Select one of the buttons, and then ctrl+click a file to open it in a new tab. If that works, then you simply need to right-click instead and copy the link. That should work.

zaszlo commented 5 years ago

Ctrl+Clicking my tiddlywiki file it wont open in a new tab and the link won't change, will remain the same https://twcloud.github.io/dropbox/?type=apps .

Arlen22 commented 5 years ago

If you right click and copy link address, what comes up?

zaszlo commented 5 years ago

javascript:false;

Arlen22 commented 5 years ago

It sounds like you're still using tw5-dropbox instead of dropbox.

zaszlo commented 5 years ago

Please elaborate it a bit, what do you mean by saying that?

If I would use only dropbox when I save my tw5 it would download it, using the tw5-dropbox that is this project, I can save without having to manually replace my tw.

Here is a screenshot of the step I would like to step over with a bookmarklet.

Arlen22 commented 5 years ago

There are two:

The first one should have links working properly as you are describing. The second one is my original one, which still works but is slightly different.

zaszlo commented 5 years ago

Thank you! Solved.