- LangHandlerJS :
File
Namespace of functions for easy access to Language actions.
- PluginHandlerJS :
File
The JavaScript file to assist installed Plugins
- PluginLoadJS :
File
The JavaScript file that handles loading Plugin Scripts on page load.
- SettingsJS :
File
The JavaScript file loaded with the Settings Page
- UniversalJS :
File
JavaScript file loaded with every single page for Universal Functions
- UniverseJS :
File
Namespace of functions for easy access to repeatable actions. Aimed at reducing complexity, and duplicity.
- UploadImageJS :
File
The JavaScript file loaded with the Upload Image Page.
Namespace of functions for easy access to Language actions.
Kind: global variable
The namepsace to access all internal functions.
Kind: static property of LangHandlerJS
Namepspace:
Implementation of Composite Formatting from C# This is at its core based on the Stack Overflow Implementation found and reworked by Gabriel Nahmias. Which was agiain reworked by myself to work as a standalone method. https://stackoverflow.com/a/18234317/12707685 This will accept a composite formatted string for ease of translations.
Kind: static method of langHandler
Summary: Implementation of Composite Formatting from C#.
Param | Type | Description |
---|---|---|
arg0 | string |
The String to preform the method on. |
argN | string |
All other arguments afterwards can be keys, with as many as needed to fill the string. Not enough or to many causing zero errors. |
Example
langHandler.UnicornComposite("How is this for a {0}, I hope it {1}", "Test", "Works");
// Outputs: "How is this for a Test, I hope it Works."
The JavaScript file to assist installed Plugins
Kind: global variable
- PluginHandlerJS :
File
- .pluginAPI :
object
- .ReturnItems(pluginName) ⇒
Array.HTMLCollection
- .ParseConfig(rawConfig) ⇒
Object
- .ReturnItems(pluginName) ⇒
- .pluginAPI :
The namespace to access all PluginHandler internal functions
Kind: static namespace of PluginHandlerJS
- .pluginAPI :
object
- .ReturnItems(pluginName) ⇒
Array.HTMLCollection
- .ParseConfig(rawConfig) ⇒
Object
- .ReturnItems(pluginName) ⇒
Returns a live HTMLCollection that use the specified plugin.
Kind: static method of pluginAPI
Returns: Array.HTMLCollection
- Live array of the DOM Element using the plugin.
Param | Type | Description |
---|---|---|
pluginName | string |
is the name of the Plugin to search for. |
Parses saved configuration data for plugins.
Kind: static method of pluginAPI
Returns: Object
- A Parsed JSON Object of the configuration data.
Param | Type | Description |
---|---|---|
rawConfig | string |
takes the raw string confiuration data. |
The JavaScript file that handles loading Plugin Scripts on page load.
The JavaScript file loaded with the Settings Page
Kind: global variable
- SettingsJS :
File
Registers onclick
handlers wherever relavent within the page.
Kind: static method of SettingsJS
Implements: universe.SnackbarCommon()
, langHandler.UnicornComposite()
, removeHeaderPlugin()
, changeOptionsAPI()
Simplifies removing a Header Plugin from User Settings using GoPage APIs
Kind: static method of SettingsJS
Implements: universe.CreateJSONPOSTHeaders()
, universe.SnackbarCommon()
, langHandler.UnicornComposite()
, universe.SnackbarError()
Param | Type | Description |
---|---|---|
side | string |
Indicates the which Side the Header Plugin is being removed from. Valid Values: "right", "left" |
Simplified method of making API Calls to GoPage API to change user settings.
Kind: static method of SettingsJS
Implements: doesJSONParse()
, universe.SnackbarError()
, universe.SnackbarCommon()
, langHandler.UnicornComposite()
Param | Type | Description |
---|---|---|
item | string |
The Identifier of the Item being changed. |
value | string |
The Value said Identifier is being changed to. |
Method of checking if passed data will parse into JSON without any errors.
Kind: static method of SettingsJS
Returns: boolean
- True if successfully parsed, false if it fails to parse.
Param | Type | Description |
---|---|---|
data | string |
The data to test against. |
JavaScript file loaded with every single page for Universal Functions
Kind: global variable
Loads the TimeStamp and modifies the HTML to reflect the current time.
Kind: static method of UniversalJS
Uses setInterval
to call loadTimeStamp()
every 1000 milliseconds (1 Second)
Kind: static method of UniversalJS
Implements: loadTimeStamp()
Queries GoPage APIs to determine and set a background image if needed, injecting it into the DOM.
Kind: static method of UniversalJS
Namespace of functions for easy access to repeatable actions. Aimed at reducing complexity, and duplicity.
Kind: global variable
- UniverseJS :
File
- .universe :
object
- .SnackbarCommon(id, textToShow, [callback], [extraClass], [img], [alt], [additionalDetails])
- .SnackbarError(id, textToShow, [callback], [details])
- .ReloadCallback() ⇒
function
- .CreateJSONPOSTHeaders(data) ⇒
Object
- .ShowModal(id)
- .CloseModal(id)
- .ShowTemplateModal(text)
- .WriteUserSettings(requestOptions, successCallback, errorCallback)
- .GenericErrorHandler(snackbar, msg)
- .FindReturnsString(action, status) ⇒
string
- .HotReload(elementID, url, callback, callbackArg)
- .Loader(shouldShow)
- .ChangeLangAPI(chosenLang)
- .universe :
The namespace to access all internal functions.
Kind: static namespace of UniverseJS
- .universe :
object
- .SnackbarCommon(id, textToShow, [callback], [extraClass], [img], [alt], [additionalDetails])
- .SnackbarError(id, textToShow, [callback], [details])
- .ReloadCallback() ⇒
function
- .CreateJSONPOSTHeaders(data) ⇒
Object
- .ShowModal(id)
- .CloseModal(id)
- .ShowTemplateModal(text)
- .WriteUserSettings(requestOptions, successCallback, errorCallback)
- .GenericErrorHandler(snackbar, msg)
- .FindReturnsString(action, status) ⇒
string
- .HotReload(elementID, url, callback, callbackArg)
- .Loader(shouldShow)
- .ChangeLangAPI(chosenLang)
universe.SnackbarCommon(id, textToShow, [callback], [extraClass], [img], [alt], [additionalDetails])
Common method for creating Snackbars onscreen, usually not directly accessed, instead accessed through a higher level function.
Kind: static method of universe
Implements: ShowTemplateModal()
Param | Type | Description |
---|---|---|
id | string |
Div ID of the Snackbar to target. |
textToShow | string |
The Text that will appear within the Snackbar. |
[callback] | function |
Optional function to execute after the Snackbar has disappeared. |
[extraClass] | string |
Optional className to provide. Not needed to be set when accessing from a higher function. |
[img] | string |
Optional Relative path to an Image Icon to display alongside the text. |
[alt] | string |
Optional ALT tag for the Image thats being displayed. |
[additionalDetails] | string |
Optional details that will show in a modal if the Snackbar image is clicked. Setting additional details also makes the Snackbar Image clickable. |
Example
universe.SnackbarCommon("homePageSnackbar", "Success", universe.ReloadCallback());
Example (A More Complex Example)
universe.SnackbarCommon(
"snackbar",
langHandler.UnicornComposite(string, i18n_returnValueLinkItem),
universe.HotReload("linkItemList", "/", homePageInit, "reload")
);
Simple way to create an Error Snackbar, defaulting many values passed to SnackbarCommon.
Kind: static method of universe
Implements: SnackbarCommon()
Param | Type | Description |
---|---|---|
id | string |
Div ID of Snackbar to target. |
textToShow | string |
The Text that will appear within the Snackbar. |
[callback] | function |
Optional function to execute after the Snackbar has disappeared. |
[details] | string |
Optional details that will show in a modal if the Snackbar Image is clicked. |
Provides a simple way to reload the page within callbacks. Since the standard location.reload()
losses scope inside a callback.
Kind: static method of universe
Returns: function
- Globally Scoped function to reload page: window.location.reload.bind(window.location)
Provides a simple way to retreive POST JSON Headers for use with Fetch requests.
Kind: static method of universe
Returns: Object
- Fetch Request Options with provided data.
Param | Type | Description |
---|---|---|
data | string |
JSON Object to set as the body of the Fetch details. |
Sets a Modal's Display to "block" to show it on the page.
Kind: static method of universe
Param | Type | Description |
---|---|---|
id | string |
Is the DOM ID of the Modal to Display. |
Sets a Modal's Display to "none" to remove it from the page.
Kind: static method of universe
Param | Type | Description |
---|---|---|
id | string |
Is the DOM ID of the Modal to Remove. |
Will show an onscreen modal assuming the Template Modal Page is used. And will handle the closing of said modal.
Kind: static method of universe
Implements: CloseModal()
, ShowModal()
Param | Type | Description |
---|---|---|
text | string |
Is the Text to show within the Modal. |
Uses GoPage APIs to set new UserSettings to the Server.
Kind: static method of universe
Param | Type | Description |
---|---|---|
requestOptions | string |
Will be the Request Options passed to Fetch for the request |
successCallback | function |
The function to execute if the query is successful. |
errorCallback | function |
The function to execute if the query fails. The error callback is REQUIRED to accept a JSON Object of the error. |
Intended to be a simple way to create an Error Snackbar that has now been superseded by SnackbarError.
Kind: static method of universe
Implements: SnackbarError()
Todo
- Determine if this is still needed or in use.
Param | Type | Description |
---|---|---|
snackbar | string |
DOM ID of the Snackbar to Target. |
msg | string |
The Message to display in the text of the Snackbar and to output to the console. |
Can be used to help determine the right translated message. This does require that returnGlobalJS template is in use on the page. This will use the Global Strings to attempt to return the right action that has been preformed.
Kind: static method of universe
Returns: string
- The translated string needed, Remember this will likely be a Composite String and shouldn't be displayed as is.
Param | Type | Description |
---|---|---|
action | string |
Is the action that has occured. Valid values: "delete", "install", "update" |
status | string |
Is the status of said action. Valid Values: "pass", "fail" |
Adds an easy way to Hot-Reload pages that are capable of doing so server side.
Kind: static method of universe
Param | Type | Description |
---|---|---|
elementID | string |
The DOM ID of the element to replace in the Hot-Reload Action. |
url | string |
The URL to query for Hot-Reloading page data. |
callback | function |
Function to execute after the Hot-Reload is finished. Useful for calling any functions needed to add Event Handlers or process data on the page. |
callbackArg | string |
Arguments to pass to the callback function, useful if the callback needs to identify that its a callback. |
Example
universe.HotReload("linkItemList", "/", homePageInit, "reload");
Simple method of injecting a Loading animation onto the center of the page.
Kind: static method of universe
Param | Type | Description |
---|---|---|
shouldShow | boolean |
indicates if the loader is being turned off or on. True being on, and False being off. |
Allowing easy universal access to the ChangeLangAPI, by just submitting the chosenLang
Kind: static method of universe
Param | Type | Description |
---|---|---|
chosenLang | string |
The two digit language code that the server should save |
The JavaScript file loaded with the Upload Image Page.
Kind: global variable
- UploadImageJS :
File
Builds the main content of the UploadImage Page. By using GoPage API's to check saved images, and display them.
Kind: static method of UploadImageJS
Todo
- Inline with the Neutuer JavaScript Initiative, this should be done in Golang, and injected into the template.
Helps loadAvailableImages to build the page, by returned an HTML string
Kind: static method of UploadImageJS
Returns: string
- HTML typed string, containing an IMG DOM Element
Param | Type | Description |
---|---|---|
imageLoc | string |
is the URL to access the image. |
Will attempt to save the specified image as the Users background image.
Kind: static method of UploadImageJS
Param | Type | Description |
---|---|---|
name | string |
is the name of the image you want to set as the background image. |
Will query GoPage API's to remove whatever is currently set as the User Image
Kind: static method of UploadImageJS
Will allow an easy way of writing to user settings and setting up an error callback
Kind: static method of UploadImageJS