/adapt-close

An extension to add a close button and/or prompts.

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

adapt-close

An extension to add a close button and/or prompts.

Installation

  • Copy the extension folder into the src > extensions directory and run an appropriate Grunt task.

Navigation bar

  • To add a close button to Adapt’s navigation bar, insert the following into the _navigation._extensions object in course.json:
"_close": {
	"_isEnabled": true,
	"_iconTypeClass": "icon-cross",
	"tooltip": "Close",
	"_showTooltip": true,
	"_layout": "right",
	"_promptIfIncomplete": null,
	"_promptIfComplete": null
}
  • To enable Notify prompts for this button, populate _promptIfIncomplete and/or _promptIfComplete with:
{
	"title": "Confirm close",
	"body": "Are you sure you want to close the window?",
	"okButton": "OK",
	"cancelButton": "Cancel"
}

Title bar

  • For prompts upon selecting the close button in the browser title bar, add the following to course.json:
"_close": {
	"promptIfIncomplete": "",
	"promptIfComplete": ""
}
  • Populate promptIfIncomplete and/or promptIfComplete with a custom message to enable browser dialogs.
  • Note: Firefox doesn’t currently support custom messages in its dialogs.