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

JavaScript not working in Moodle app #48

Open
parasteh opened this issue Feb 28, 2024 · 10 comments
Open

JavaScript not working in Moodle app #48

parasteh opened this issue Feb 28, 2024 · 10 comments

Comments

@parasteh
Copy link

Hi there,

I think this is more likely a moodle app security restriction, but I hope there is a way for it. What I am looking for is being able to run a simple conditional based on a value, for example if the person belongs to a team, "T1", I want to hide a link for them only. or some similar cases. This works in browser but Moodle App is not running. I tried conditional CSS even and the same thing.

Would you please advice a way or see if this can be added to the Generico somehow.
Thank you so much for your time developing this awesome plugin.

@justinhunt
Copy link
Owner

There is a viewcapability attribute and hidecapability attribute. Using this you can hide and show Generico content based on the users permissions. I don't know if this will work in the mobile app or not. But please let me know.

For more information look at the section "working with capabilities" on this page:
https://support.poodll.com/en/support/solutions/articles/19000083258-how-do-widgets-work-for-developers-

@bmadm
Copy link

bmadm commented Oct 30, 2024

Hello everyone,

I have set the Generico filter so that it opens an iFrame with a web page in the lightbox after clicking on the link. In the web version it works as desired. Unfortunately not in the mobile version. The entry 'viewcapability=“moodle/course:manageactivities”' does not change anything.
Does anyone have experience with the Generico filter in the mobile version?

@bmadm
Copy link

bmadm commented Nov 14, 2024

Hello Justin,

I have written to the people at the Moodle app about the Generico filter. I got the following answer:

The Branded Moodle App supports plugins but the plugin developer (in this case Generico) needs to ensure that they've followed the existing guidelines to make their plugins compatible with the app. You can find a list of plugins that are mobile compatible: https://moodle.org/plugins/browse.php?list=award&id=6

In this case, I'd suggest contacting the Generico developers for their plans to add support for the mobile app.

Would it be possible to customize the Generico filter so that it meets these criteria?

@justinhunt
Copy link
Owner

I am certainly willing to support the mobile app but there are few things ahead in the roadmap (which is only in my head). I am currently rewriting the Poodll filter to use mustache and clear away all the legacy stuff we did with JS back in the old days. Once that is stable and running well, I will bring those changes back to Generico. Mobile is not really a goal of this, but using Mustache in the template will allow us to do more with conditionals and data sets without getting into JS, which is where we really lose mobile support.

Having said that iframes in lightboxes is probably a step too far. I am not confident that will work from Generico, and I don't think it will be anytime soon. So you are probably best to look for an alternative

@bmadm
Copy link

bmadm commented Nov 14, 2024

Thank you for your reply.

@bmadm
Copy link

bmadm commented Nov 20, 2024

Would you be willing to accept this customization of the plugin as an order? If so, how quickly could you implement this and what would it cost us? You are welcome to send me your answer as a private message.

@justinhunt
Copy link
Owner

I don't have the capacity to take on any custom development work unfortunately. Since it is open source, I am not the only option though. In this particular case I have my doubts about the feasibility of using a lightbox from Generico in the Moodle mobile app. ie I am not sure this will work. Why don't you explain in more detail what you are trying to do.

@bmadm
Copy link

bmadm commented Nov 20, 2024

I would be happy to explain in more detail what exactly we are planning.
We offer Bible courses on our Moodle platform. There is a link to an online Bible in places where a Bible quotation occurs. Our idea is for this online Bible to be opened in the lightbox so that the context can be viewed.

@justinhunt
Copy link
Owner

I see. I am really not sure how to make that work, it seems like something would be possible. Perhaps a standard link to the online bible in those locations would be the simplest way. I wish I could be of more help, but I would need to get in and tinker around before I could say anything useful. And I am not able to do that unfortunately.

@bmadm
Copy link

bmadm commented Nov 21, 2024

That's perfectly fine! If it doesn’t work out, then so be it. I’m confident we’ll find a solution one way or another.

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