Using CLIO Functions

From CLIO

Revision as of 14:54, 20 April 2022 by Metaphoraccoon (talk | contribs) (Created page with "== Overview == There are several functions that have been created for use in the interface or other activity types that were included as part of the CLIO web application, maki...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Overview

There are several functions that have been created for use in the interface or other activity types that were included as part of the CLIO web application, making it so they can be integrated into new activity types.

Interface

getCurrentURL

Description: Returns an object with information about the current URL.

Arguments: none


Example:

getCurrentURL();


Output:

{

    "url": "http://10.0.0.50//clio/development/?program=NICOToothSleuth&activity=pathfinder",

    "base": "http://10.0.0.50//clio/development/",

    "hash": "",

    "program": "NICOToothSleuth",

    "activity": "pathfinder",

    "menu": ""

}

removeBodyClassByPrefix

Description: Removes all classes from body that begin with a prefix.

Arguments: prefix

Argument Description Expected Parameter
prefix The prefix for the classes to be removed from the body element. String


Example:

removeBodyClassByPrefix("theme_");


Output:

(All classes that start with “theme_” will be removed from the “body” object.)

removeSelectorClassByPrefix

Description: Removes all classes from the selector that begin with a prefix.

Arguments: selector, prefix

Argument Description Expected Parameter
selector An ID (“#unique_id”) or class (“.class”) selector. Valid element class or id
prefix The prefix for the classes to be removed from the selected element. String


Example:

removeBodyClassByPrefix("#menu_content_wrapper", "menu_");


Output:

(All classes beginning with “menu_” will be removed from the element with the id of “menu_content_wrapper”)

applyTheme

Description: Loads the selected theme from the CLIO theme folder and applies it, unless there is an accessibility contrast mode enabled.  This does not automatically remove existing theme classes and should be used in conjunction with removeBodyClassByPrefix(“theme_”).

Arguments: theme

Argument Description Expected Parameter
theme The name of the theme, not including the “theme_” prefix. String


Example:

applyTheme("default");


Output:

(Loads the “theme_default.css” stylesheet from the CLIO web application’s “theme” folder, contained within the “css” folder.  Then, CLIO will verify that an accessibility contrast mode is not enabled before applying the “theme_default” class to the “body” element.)

AJAX

Rich Text

Settings

Accessibility

LocalStorage

SessionStorage

Program

Activity

Audience

Discussions

Scrollbars

Look Closer