mobile supprt for plugins' "Pure Javascript plugins" problem

mobile supprt for plugins' "Pure Javascript plugins" problem

behnaz ranjbar -
Atsakymų skaičius: 1

hi everyone,

as i mentioned in the title, in the above documentation there is such topic that in my idea isn't completely expanded there so i have some questions:

1. there is a part in classes/mobile.php in the return array: 'javascript' => '  ', how we can use this part..unfortunately they didn't describe it..shall we write the .js file path here or what?

2. and there is a description about init method and using javascript in it...can you explain how does it work and how to write that init method..shall we write it in classes/mobile.php? if yes can we call 2 methods in db/mobile.php

Įvertinimų vidurkis: -
Atsakymas į behnaz ranjbar

Re: mobile supprt for plugins' "Pure Javascript plugins" problem

Dani Palou -
Core developers paveikslėlis Moodle HQ paveikslėlis Particularly helpful Moodlers paveikslėlis Peer reviewers paveikslėlis Plugin developers paveikslėlis

Hi,

  1. That javascript property needs to be the javascript code itself. We'll probably support adding file URLs in the future, but for now it must be the javascript code. So you should read the file using file_get_contents or similar and then return the contents.
  2. The init function must be specified in mobile.php, just like "method". It will be called as soon as the app is started.

Cheers,

Dani