Constructor
new AppModel()
- Source:
Extends
Methods
DOItoURL(str) → {string}
Get the URL for the online location of the object being cited when it
has a DOI. If the DOI is not passed to the function, or if the string
is not a DOI, then an empty string is returned.
Parameters:
Name |
Type |
Description |
str |
string
|
The DOI string, handles both DOI and DOI URL,
with or without prefixes |
- Since:
- Source:
Returns:
- The DOI URL
-
Type
-
string
URLtoDOI(url) → {string}
Get the DOI from a DOI URL. The URL can be http or https, can include the
"doi:" prefix or not, and can use "dx.doi.org" or "doi.org" as the
domain. If a string is not passed to the function, or if the string is
not for a DOI URL, then an empty string is returned.
Parameters:
Name |
Type |
Description |
url |
string
|
The DOI URL |
- Since:
- Source:
Returns:
- The DOI string, including the "doi:" prefix
-
Type
-
string
addCSS(css, id)
Given a string of CSS and an associated unique ID, check whether that CSS file
was already added to the document head, and add it if not. Prevents adding the
CSS file multiple times if the view is loaded more than once. The first time each
CSS path is added, we need to save a record of the event. It doesn't work to just
search the document head for the style element to determine if the CSS has
already been added, because views may be initialized too quickly, before the
previous instance has had a chance to add the stylesheet element.
Parameters:
Name |
Type |
Description |
css |
string
|
A string containing CSS styles |
id |
string
|
A unique ID for the CSS styles which has not been used
anywhere else in the app. |
- Source:
getActiveAltRepo() → {object}
Gets the currently-active alternative repository that is configured in this AppModel.
- Source:
Returns:
-
Type
-
object
getDataONEMNAPIs(baseUrlopt) → {object}
Constructs the DataONE API URLs for the given baseUrl
Parameters:
Name |
Type |
Attributes |
Description |
baseUrl |
string
|
<optional>
|
The baseUrl to use in the URLs. If not specified, it uses the AppModel attributes. |
- Source:
Returns:
-
Type
-
object
getQuickAddTaxa()
Get the config options for the Taxa Quick Add feature. IF a SID is
configured, this will fetch the taxa from the repository. Otherwise,
it will return the object set on the quickAddTaxa attribute.
- Source:
isDOI(doi) → {boolean}
Check if a string is a valid DOI.
Parameters:
Name |
Type |
Description |
doi |
string
|
The string to check. |
- Since:
- Source:
Returns:
- True if the string is a valid DOI, false otherwise.
-
Type
-
boolean
removeAllDOIPrefixes(str) → {string}
Remove all DOI prefixes from a DOI string, including https, http, doi.org,
dx.doi.org, and doi:.
Parameters:
Name |
Type |
Description |
str |
string
|
The DOI string to remove prefixes from. |
- Since:
- Source:
Returns:
- The DOI string without any prefixes.
-
Type
-
string
removeCSS(id)
Parameters:
Name |
Type |
Description |
id |
string
|
A unique ID for the CSS styles which has not been used
anywhere else in the app. The same ID used to add the CSS with
AppModel#addCSS |
- Source:
resetDescription()
Reset the web document's description to the default
- Since:
- Source:
resetTitle()
Reset the web document's title to the default
- Since:
- Source:
setActiveAltRepo()
- Source:
Fires:
- AppModel#change:activeAlternateRepositoryId