Skip to content

Commit

Permalink
Release/v5 (#50)
Browse files Browse the repository at this point in the history
* Spacing and indentation fixes

* Changed classes and some template structure

* More structure tweaks

* styling, class renaming and additions to templates

* Search theme

* Version bump

* Updated license and cross platform coverage

Co-authored-by: kineojen <[email protected]>
  • Loading branch information
guywillis and kineojen authored Jan 22, 2020
1 parent ba62b0f commit bebe60c
Show file tree
Hide file tree
Showing 14 changed files with 1,837 additions and 1,875 deletions.
31 changes: 15 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# adapt-search
# adapt-search

**Search** is an *extension* which can extend the [Adapt framework](https://github.com/adaptlearning/adapt_framework).
**Search** is an *extension* which can extend the [Adapt framework](https://github.com/adaptlearning/adapt_framework).

<img src="https://raw.githubusercontent.com/wiki/cgkineo/adapt-search/images/example.gif" alt="sample search extension">

It appears in the drawer. Either as a single item or with other items, such as [resources](https://github.com/adaptlearning/adapt-contrib-resources).
It appears in the drawer. Either as a single item or with other items, such as [resources](https://github.com/adaptlearning/adapt-contrib-resources).

## Installation

Expand All @@ -16,7 +16,7 @@ It appears in the drawer. Either as a single item or with other items, such as [

### General Attributes

The attributes listed below are used in *course.json* to configure **Search**, and are properly formatted as JSON in [*example.json*](https://github.com/cgkineo/adapt-search/blob/master/example.json).
The attributes listed below are used in *course.json* to configure **Search**, and are properly formatted as JSON in [*example.json*](https://github.com/cgkineo/adapt-search/blob/master/example.json).


**title** (string): Extension title, defaults to "Search".
Expand All @@ -32,8 +32,8 @@ The attributes listed below are used in *course.json* to configure **Search**, a
**awaitingResultsMessage**: Message between having enough characters to search and having search results (More than 2 characters per word). Defaults to "Formulating results...".

**_showHighlights** (boolean): Show the yellow highlights on search results.
**_showFoundWords** (boolean): Show found words under the search results.

**_showFoundWords** (boolean): Show found words under the search results.

**_previewWords** (integer): The number of words taken from either side of the matching word. Defaults to 15.

Expand All @@ -43,24 +43,23 @@ The attributes listed below are used in *course.json* to configure **Search**, a
### Item Attributes


The attributes listed below are used in *contentObject.json*, *articles.json*, *blocks.json* and *components.json* to configure **Search Items**, and are properly formatted as JSON in [*example.json*](https://github.com/cgkineo/adapt-search/blob/master/example.json).
The attributes listed below are used in *contentObject.json*, *articles.json*, *blocks.json* and *components.json* to configure **Search Items**, and are properly formatted as JSON in [*example.json*](https://github.com/cgkineo/adapt-search/blob/master/example.json).

**_search** (object): Object to designate search settings.
**_search** (object): Object to designate search settings.

>**keywords** array(string): An array of strings detailing the important search phrases for the course section.
>**keywords** array(string): An array of strings detailing the important search phrases for the course section.
**NOTE**: Keywords are exported with the `grunt translate:export` command. When localising content, use a process that ensures translated keywords are found in the actual translated course content.

<div float align=right><a href="#top">Back to Top</a></div>

## Limitations

No known limitations.

No known limitations.

----------------------------
**Version number:** 2.3.3 <a href="https://community.adaptlearning.org/" target="_blank"><img src="https://github.com/adaptlearning/documentation/blob/master/04_wiki_assets/plug-ins/images/adapt-logo-mrgn-lft.jpg" alt="adapt learning logo" align="right"></a>
**Framework versions:** 2.2+
**Author / maintainer:** Kineo and community with [contributors](https://github.com/cgkineo/adapt-search/graphs/contributors)
**Accessibility support:** WAI AA
**Version number:** 3.0.0 <a href="https://community.adaptlearning.org/" target="_blank"><img src="https://github.com/adaptlearning/documentation/blob/master/04_wiki_assets/plug-ins/images/adapt-logo-mrgn-lft.jpg" alt="adapt learning logo" align="right"></a>
**Framework versions:** 5+
**Author / maintainer:** Kineo and community with [contributors](https://github.com/cgkineo/adapt-search/graphs/contributors)
**Accessibility support:** WAI AA
**RTL support:** No
**Cross-platform coverage:** Chrome, Chrome for Android, Firefox (ESR + latest version), Edge, IE11, IE Mobile 11, Safari 11+12 for macOS+iOS, Opera
**Cross-platform coverage:** Chrome, Chrome for Android, Firefox (ESR + latest version), Edge, IE11, Safari 12+13 for macOS/iOS/iPadOS, Opera
38 changes: 19 additions & 19 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"name": "adapt-search",
"repository": {
"type": "git",
"url": "git://github.com/cgkineo/adapt-search"
},
"framework": ">=2.2",
"version": "2.3.3",
"homepage": "https://github.com/cgkineo/adapt-search",
"issues": "https://github.com/cgkineo/adapt-search/issues/",
"displayName": "Search",
"extension": "search",
"description": "Keyword-search extension for Adapt",
"main": "/js/adapt-search.js",
"keywords": [
"adapt-plugin",
"adapt-extension"
],
"license": "GPLv3",
"targetAttribute": "_search"
"name": "adapt-search",
"repository": {
"type": "git",
"url": "git://github.com/cgkineo/adapt-search"
},
"version": "3.0.0",
"framework": ">=5",
"homepage": "https://github.com/cgkineo/adapt-search",
"issues": "https://github.com/cgkineo/adapt-search/issues/",
"extension": "search",
"displayName": "Search",
"description": "Keyword-search extension for Adapt",
"main": "/js/adapt-search.js",
"keywords": [
"adapt-plugin",
"adapt-extension"
],
"license": "GPL-3.0",
"targetAttribute": "_search"
}
189 changes: 89 additions & 100 deletions example.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// on each searchable contentObject, article, block or component
{
// on each searchable contentObject, article, block or component
"_search": {
"_isEnabled": true,
"keywords": [
Expand All @@ -9,104 +8,94 @@
"content"
]
}
}

// in course.json
"_search": {
"_isEnabled": true,
"_drawerOrder": 0,
"title": "",
"description": "Type in search words and enter",
"noResultsMessage": "Sorry, no results were found",
"awaitingResultsMessage": "Formulating results...",
"_showHighlights": true,
"_showFoundWords": true,
"_previewWords": 15,
"_previewCharacters": 30
}



// override if needed in course.json
"_search": {
"_previewWords": 15,
"_previewCharacters": 30,
// in course.json
"_search": {
"_isEnabled": true,
"_drawerOrder": 0,
"title": "",
"description": "Type in search words and enter",
"noResultsMessage": "Sorry, no results were found",
"awaitingResultsMessage": "Formulating results...",
"_showHighlights": true,
"_showFoundWords": true,
"_previewWords": 15,
"_previewCharacters": 30
}

"_searchAttributes": [
{
"_attributeName": "_search",
"_level": 1,
"_allowTextPreview": false
},
{
"_attributeName": "_keywords",
"_level": 1,
"_allowTextPreview": false
},
{
"_attributeName": "keywords",
"_level": 1,
"_allowTextPreview": false
},
{
"_attributeName": "displayTitle",
"_level": 2,
"_allowTextPreview": true
},
{
"_attributeName": "body",
"_level": 3,
"_allowTextPreview": true
},
{
"_attributeName": "alt",
"_level": 4,
"_allowTextPreview": false
},
{
"_attributeName": "_alt",
"_level": 4,
"_allowTextPreview": false
},
{
"_attributeName": "_items",
"_level": 5,
"_allowTextPreview": false
},
{
"_attributeName": "items",
"_level": 5,
"_allowTextPreview": false
// override if needed in course.json
"_search": {
"_previewWords": 15,
"_previewCharacters": 30,
"_searchAttributes": [
{
"_attributeName": "_search",
"_level": 1,
"_allowTextPreview": false
},
{
"_attributeName": "_keywords",
"_level": 1,
"_allowTextPreview": false
},
{
"_attributeName": "keywords",
"_level": 1,
"_allowTextPreview": false
},
{
"_attributeName": "displayTitle",
"_level": 2,
"_allowTextPreview": true
},
{
"_attributeName": "body",
"_level": 3,
"_allowTextPreview": true
},
{
"_attributeName": "alt",
"_level": 4,
"_allowTextPreview": false
},
{
"_attributeName": "_alt",
"_level": 4,
"_allowTextPreview": false
},
{
"_attributeName": "_items",
"_level": 5,
"_allowTextPreview": false
},
{
"_attributeName": "items",
"_level": 5,
"_allowTextPreview": false
},
{
"_attributeName": "text",
"_level": 5,
"_allowTextPreview": true
}
],
"_hideComponents": [
"blank"
],
"_hideTypes": [
],
"_ignoreWords": [
"a","an","and","are","as","at","be","by","for",
"from","has","he","in","is","it","its","of","on",
"that","the","to","was","were","will","wish","",
],
"_matchOn": {
"_contentWordBeginsPhraseWord": false,
"_contentWordContainsPhraseWord": false,
"_contentWordEqualsPhraseWord": true ,
"_phraseWordBeginsContentWord": true
},
{
"_attributeName": "text",
"_level": 5,
"_allowTextPreview": true
}
],

"_hideComponents": [
"blank"
],

"_hideTypes": [

],

"_ignoreWords": [
"a","an","and","are","as","at","be","by","for",
"from","has","he","in","is","it","its","of","on",
"that","the","to","was","were","will","wish","",
],

"_matchOn": {
"_contentWordBeginsPhraseWord": false,
"_contentWordContainsPhraseWord": false,
"_contentWordEqualsPhraseWord": true ,
"_phraseWordBeginsContentWord": true
},

"_scoreQualificationThreshold": 20,
"_minimumWordLength": 2,
"_frequencyImportance": 5
}
"_scoreQualificationThreshold": 20,
"_minimumWordLength": 2,
"_frequencyImportance": 5
}
Loading

0 comments on commit bebe60c

Please sign in to comment.