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

plugin request : Action Bar #70

Open
kwolbachia opened this issue Nov 10, 2021 · 18 comments
Open

plugin request : Action Bar #70

kwolbachia opened this issue Nov 10, 2021 · 18 comments

Comments

@kwolbachia
Copy link

Hello,
I think the Action Bar plugin would be very usefull for tool sharing and testing via imageJ.js
it creates personnalized buttons that can run macros or beanshell scripts.
the bars can be integrated to imageJ main bar or sticked to opened image or free floating.
it has the possibility to generate a bar from a simple string , for example optained from a raw gist URL.
It really is a great way to make macro scripts user friendly!

links :
https://figshare.com/articles/dataset/Custom_toolbars_and_mini_applications_with_Action_Bar/3397603/12?file=26749979
https://github.com/mutterer/ActionBar

and an example bar that I'd like to share in imagej.js
https://forum.image.sc/t/new-tool-colorblind-bar/53634

Hope you'll like the idea,
Best,
Kevin

@oeway
Copy link
Contributor

oeway commented Nov 12, 2021

Hi Kevin, thanks for the request! I will give it a try!

Edit: Let's see how it goes: imjoy-team/ImageJA.JS@dc76d11

@kwolbachia
Copy link
Author

Thanks Wei that was fast! Sorry I tried things from there but I don't really know what I'm doing right now x)
am I supposed to test it with the "Compile ImageJ into Javascript" way in your wiki?

@oeway
Copy link
Contributor

oeway commented Nov 12, 2021

I will need to trigger the CI rebuild on this repo, then you will get it at ij.ImJoy.io

@kwolbachia
Copy link
Author

That's awesome!
Thank you again

@oeway
Copy link
Contributor

oeway commented Nov 12, 2021

@kwolbachia It's now deployed, however, due to browser caching you need to use incognito mode in Chrome to open https://ij.imjoy.io

There is another issue, I got an error and it seems that actionbar try to save to plugins folder which is readonly for this case. See below:
Screen Shot 2021-11-12 at 2 11 26 PM

@mutterer Can we save it to another path? E.g. you can write to /files/ in imagej.js.

@kwolbachia
Copy link
Author

There is one problem, I didn't see that the github rep of Action Bar is not udated, the real last version is there :
https://sites.imagej.net/Mutterer/plugins/ (action_bar.jar-20210614214121)
The github jar is from 2015 ^^'
In the last version I think this macro code should work for opening an Action Bar from a url :
run("Action Bar",File.openUrlAsString("https://raw.githubusercontent.com/kwolbachia/Imagej-macro-addiction/main/Colorblind%20Bar/CB_Bar_fromstring.ijm"));
if it works, this "from string" function allows to avoid the need of a saved file in the Action Bar folder

@oeway
Copy link
Contributor

oeway commented Nov 12, 2021

Ok, I will update that then.

@mutterer
Copy link

Hi @oeway @kwolbachia ,
Thanks for your efforts for making ActionBar available in ImageJ.JS
Let me know if any update to AB is needed.
I also think it would be better if the non working examples were removed from the ActionBar menu, so that nobody gets confused. I'll try to update the script that is run when calling the basic "Action Bar" command to make it work with the "from string" concept.

@oeway
Copy link
Contributor

oeway commented Nov 15, 2021

@kwolbachia I just updated: imjoy-team/ImageJA.JS@3c8924c Will take some time to comiple and then I will trigger an update on imagej.js site.

@kwolbachia
Copy link
Author

Thanks again @oeway !

@oeway
Copy link
Contributor

oeway commented Nov 15, 2021

@kwolbachia It's ready now.

@mutterer With the latest version we still get the error with "Erro Install Action Bar in plugins/ActionBar/" mostly due to the reason I mentioned above. Do you have any idea on how to fix that?

@kwolbachia
Copy link
Author

imageJ js_ActionBar

This is awesome, the fromString way work perfectly! : http://tiny.cc/imagejJS_ActionBar

@kwolbachia
Copy link
Author

Hi @oeway ,
About the necessity of private window on chrome, I don't really understand if it's a temporary thing or forever?

@mutterer
Copy link

mutterer commented Nov 16, 2021

Hi @oeway, @kwolbachia

enabling writing action bars to /files/ could be made to work, but I don't think it makes a lot a sense, as those would be lost across browser sessions. I'd rather suggest replacing the createAB.txt macro content by a simple message to the Log window that in ImageJ.JS, the recommended method to create ActionBars are to host the bar code on e.g. github. and maybe point to some example code:

The createAB.txt could be:

print ("//With ImageJ.JS, we recommended the following method to create Action Bars:");
print ("//host your bars in a GitHub repository");
print ("//use the <fromString> tag to inject the bar's code to the ActionBar plugin");
print ("s=File.openUrlAsString('https://raw.githubusercontent.com/mutterer/weird/master/embeded_bar.ijm');");
print ("run('Action Bar',s);");

Either please replace the file above, or let me know where I can make the PR. Thanks!

@oeway
Copy link
Contributor

oeway commented Nov 19, 2021

@mutterer /files/ endpoint is a an IndexedDB-based, persistent read-write file system, so the data won't be lost across browser sessions, only if the user decided to clear all the browser data which I would assume user don't do often. For me it would make sense to store there.

@kwolbachia The incognito mode won't be needed if I bump there version, and I just did it, could you try it and see if it works? You might need to refresh the page once.

@kwolbachia
Copy link
Author

Hi @oeway,
at this moment nothing changed for me : I see Action Bar only on chrome incognito.
And when I try my current browser Firefox in incognito, imageJ.js loads forever.
I will try again later

@kwolbachia
Copy link
Author

Hi @oeway ,
I tried again and I can see Action Bar only on chrome in mac.
I need incognito in windows to see it
and never see it on Firefox.
I can have either the v0.5.1 or v0.5.4 depending on the browser / os

@kwolbachia
Copy link
Author

Hi @oeway
I realized I needed to clear browser cookies and data to see the Action Bar plugin
So everything works everywhere now! Thanks again for implementing this :)
Best,
Kevin

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