When returning to Moodle let the user select which course to add the resource to.
- Source:
- Copyright:
- 2020 Mathew May
- 2020 Mathew May
- License:
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Members
(inner) The :string
id corresponding to the import.
Type:
- string
Methods
(inner) addCourses(page)
Fetch the courses to show the user. We use the same WS structure & template as the search for consistency.
Parameters:
Name | Type | Description |
---|---|---|
page |
HTMLElement | The whole page element for our course page |
(inner) debounce(func, wait, immediate) → {function}
- Source:
- Copyright:
- 2009-2020 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
Define our own debounce function as Moodle 3.7 does not have it.
Parameters:
Name | Type | Description |
---|---|---|
func |
function | The function we want to keep calling |
wait |
number | Our timeout |
immediate |
boolean | Do we want to apply the function immediately |
Returns:
- Type
- function
(inner) init(importIdString)
Set up the page.
Parameters:
Name | Type | Description |
---|---|---|
importIdString |
string | the string ID of the import. |
(inner) registerListenerEvents(page)
Add the event listeners to our page.
Parameters:
Name | Type | Description |
---|---|---|
page |
HTMLElement | The whole page element for our page |
(inner) searchCourses(inputValue, page, areaReplace)
For a given input, the page & what to replace fetch courses and manage icons too.
Parameters:
Name | Type | Description |
---|---|---|
inputValue |
string | What to search for |
page |
HTMLElement | The whole page element for our page |
areaReplace |
HTMLElement | The Element to replace the contents of |