Skip to content

Commit

Permalink
Documentation updates, add new global scrollDown property
Browse files Browse the repository at this point in the history
  • Loading branch information
swashbuck committed Dec 5, 2024
1 parent 826dbda commit a7e814c
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 19 deletions.
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
# adapt-scrollPrompt

The **Scroll Prompt** extension is a visual aid that helps users navigate through a course.
The **Scroll Prompt** extension is a visual aid that helps users navigate through a course. The plugin adds a button that will auto scroll to the next element when clicked.

The plugin adds a button that will auto scroll to the next element. This button can be appended to menu headers, page headers, blocks, and components. For blocks and components, the button will be placed at the end of the block / component to ensure content is not skipped over. Additional instruction text can be applied alongside the button.
This button can be appended to:

- Menu headers
- Page headers
- Blocks
- Components

For blocks and components, the button will be placed at the end of the block / component to ensure content is not skipped over. Additional instruction text can be applied alongside the button.

---

**Author / maintainer:** CGKineo <br>
**Accessibility support:** WAI AA <br>
**RTL support:** Yes <br>
**Cross-platform coverage:** Chrome, Chrome for Android, Firefox (ESR + latest version), Edge, IE11, Safari 14 for macOS/iOS/iPadOS, Opera <br>
**Author / maintainer:** Kineo<br>
**Accessibility support:** WAI AA<br>
**RTL support:** Yes<br>
**Cross-platform coverage:** Chrome, Chrome for Android, Firefox (ESR + latest version), Edge, Safari for macOS/iOS/iPadOS, Opera<br>
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"displayName": "Scroll Prompt",
"extension": "scrollPrompt",
"targetAttribute": "_scrollPrompt",
"description": "Apply scroll prompt to course menu and page headers. An icon to add visual aid for scrolling as well as auto scroll functionality.",
"description": "A visual aid that helps users navigate through a course. The plugin adds a button that will auto scroll to the next element when clicked.",
"main": "/js/adapt-scrollPrompt.js",
"keywords": [
"adapt-plugin",
Expand Down
4 changes: 2 additions & 2 deletions example.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

"_scrollPrompt": {
"_isEnabled": true,
"instruction": "Scroll down"
}
"instruction": "{{_globals._extensions._scrollPrompt.scrollDown}}"
}
3 changes: 2 additions & 1 deletion js/ScrollPromptView.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ export default class ScrollPromptView extends Backbone.View {
}

render() {
const _scrollPrompt = this.model.get('_scrollPrompt');
const data = {
...this,
model: this.model.toJSON(),
_scrollPrompt: this.model.get('_scrollPrompt')
_scrollPrompt
};
ReactDOM.render(<templates.scrollPrompt {...data} />, this.el);

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"displayName": "Scroll Prompt",
"extension": "scrollPrompt",
"targetAttribute": "_scrollPrompt",
"description": "Apply scroll prompt to course menu and page headers. An icon to add visual aid for scrolling as well as auto scroll functionality.",
"description": "A visual aid that helps users navigate through a course. The plugin adds a button that will auto scroll to the next element when clicked.",
"main": "/js/adapt-scrollPrompt.js",
"keywords": [
"adapt-plugin",
Expand Down
24 changes: 17 additions & 7 deletions properties.schema
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
{
"type":"object",
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema",
"id": "http://jsonschema.net",
"required":false,
"globals": {
"scrollDown": {
"type": "string",
"required": true,
"default": "Scroll down",
"inputType": "Text",
"validators": [],
"translatable": true
}
},
"properties":{
"pluginLocations": {
"type":"object",
"type": "object",
"required":true,
"properties":{
"config": {
"type":"object"
"type": "object"
},
"course": {
"type":"object",
"type": "object",
"properties": {
"_scrollPrompt": {
"type": "object",
Expand All @@ -38,7 +48,7 @@
}
},
"contentobject": {
"type":"object",
"type": "object",
"properties": {
"_scrollPrompt": {
"type": "object",
Expand All @@ -64,7 +74,7 @@
}
},
"block": {
"type":"object",
"type": "object",
"properties": {
"_scrollPrompt": {
"type": "object",
Expand All @@ -90,7 +100,7 @@
}
},
"component": {
"type":"object",
"type": "object",
"properties": {
"_scrollPrompt": {
"type": "object",
Expand Down
2 changes: 1 addition & 1 deletion templates/scrollPrompt.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default function ScrollPrompt (props) {
return (
<div className="scrollPrompt__inner a11y-ignore" aria-hidden="true">
<button className="btn-icon scrollPrompt__btn" onClick={onScrollPromptClick}>
<div className="icon" />
<span className="icon" />
</button>

{_scrollPrompt.instruction &&
Expand Down

0 comments on commit a7e814c

Please sign in to comment.