Namespace

MeadCo

MeadCo

Static class for namespace creation and core utility functions for ScriptX.Services client libraries.

This must be included before any other files from this package.

The implementation is for use in a browser only, not general runtime javascript environments.

This code is necessarily 'old-fashioned' as it may find itself running in old versions of IE.

View Source meadco-core.js, line 1

Members

# static logEnabled

Get/set state of logging to console of informational messages. Default is off

Properties:
Name Type Description
logEnabled boolean

View Source meadco-core.js, line 200

# static version

Get the version of this module as a string major.minor.hotfix.build

Properties:
Name Type Description
version string

View Source meadco-core.js, line 193

Methods

# static createNS(namespace) → {object}

Create a namespace

Parameters:
Name Type Description
namespace string

path of the namespace

View Source meadco-core.js, line 205

static object for the namespace

object
Example
var ui = MeadCo.createNS("MeadCo.ScriptX.Print.UI");
ui.Show = function() { alert("hello"); }

# static error(text)

Marks the content as an error and sends to the console

Parameters:
Name Type Description
text string

to send to console

View Source meadco-core.js, line 180

# static log(text)

Sends the content to the console (if informational logging is enabled)

Parameters:
Name Type Description
text string

to send to console

View Source meadco-core.js, line 164

# static makeApiEndPoint(serverUrl, apiLocation) → {string}

Get the url to a ScriptX.Services api. If an api is already present, it is replaced.

Parameters:
Name Type Description
serverUrl string

url to the server

apiLocation string

the api, e.g. v1/printhtml

View Source meadco-core.js, line 247

url to the api

string

# static makeServiceEndPoint(serverUrl, endPoint) → {string}

Get the url to a ScriptX.Services service endpoint.

Parameters:
Name Type Description
serverUrl string

url to the server

endPoint string

the service endpoint, e.g. v1/preview

View Source meadco-core.js, line 272

url to the endpoint

string

# static parseAjaxError(logText, jqXhr, textStatus, errorThrown) → {string}

Extract the error text from jQuery AJAX response

Parameters:
Name Type Description
logText string

The lead-in text for a console.log entry

jqXhr object

jQuery ajax header

textStatus string

textStatus result determined by jQuery

errorThrown string

The server exception dewtermined by jQuery

View Source meadco-core.js, line 298

The error text to display

string

# static warn(text)

Marks the content as a warning and sends to the console

Parameters:
Name Type Description
text string

to send to console

View Source meadco-core.js, line 172