Home User Documentation Developer Documentation GitHub

Namespace: msg

plastic. msg

Global Message Function

This draws a visible Error Message into the plastic element, if a reference to the element is given.

Should be used instead of console.log

TODO
  • Add an Close Button?

Members

private,staticplastic.msg._logsArray

Log Array

If debugging is enabled, all infos, warnings and errors will be saved here

Methods

staticplastic.msg.createLogEntry(msg, type, el)

core/msg.js, line 102

Creates a new log entry object if logging is enabled

Name Type Description
msg string | Object

Message String or Object

type string

Message Type

el Object optional

concerning plastic.js DOM element

staticplastic.msg.createNotification(msg, type, el)

core/msg.js, line 130

Creates a new notification within the plastic-js-messages div

Name Type Description
msg string | Object

Message String or Object

type string

Message Type

el Object optional

concerning plastic.js DOM element or concerning plastic element

TODO
  • Check if msg is an Object, if it is use pre tag for displaying it

staticplastic.msg.dir(obj)

core/msg.js, line 52

Logs an Object to the Log Object and the console

Name Type Description
obj Object

Message String or Object

Example

plastic.msg.dir(myObject);

staticplastic.msg.dumpLogJSON()

core/msg.js, line 156

Parses the Log Object to a JSON string and dumps the string and the object into the console

staticplastic.msg.dumpLogObject()

core/msg.js, line 147

Parses the Log Object to a JSON string and dumps the string and the object into the console

staticplastic.msg.error(msg, el)

core/msg.js, line 79

Logs and outputs an error

Can be given an error string or object

Name Type Description
msg string

Log Message

el Object optional

plastic element to append the message on

staticplastic.msg.log(msg, el)

core/msg.js, line 35

Logs a Message or Object to the Log Object and the console

Name Type Description
msg string | Object

Message String or Object

el Object optional

concerning plastic.js DOM element

Example

plastic.msg.log('For your information', this.$el);

staticplastic.msg.prettyPrintJSON(json){string}

core/msg.js, line 172

Pretty prints an JSON Object to an HTML string

Name Type Description
json Object

JSON Object

TODO
  • Wrap it into a pre tag
Returns:
String

staticplastic.msg.warn(msg, el)

core/msg.js, line 64

Logs a Warning Message or Object to the Log Object and the console

Name Type Description
msg string | Object

Message String or Object

el Object optional

concerning plastic.js DOM element