Prettified all files.

This commit is contained in:
2019-07-18 12:26:39 +02:00
parent 7744b92771
commit 2d400a18ec
125 changed files with 11184 additions and 8154 deletions
+30 -28
View File
@@ -1439,11 +1439,11 @@
</header>
<article>
<pre id="source-code" class="prettyprint source linenums"><code>import Theme from './theme.js'
import {InteractivePopup} from './popup.js'
import { InteractivePopup } from './popup.js'
/**
* Class that represents a Message. A message pops up and disappears after a specific amount of time.
*
*
* @example
* // Create the PixiJS App
* const app = new PIXIApp({
@@ -1451,7 +1451,7 @@ import {InteractivePopup} from './popup.js'
* width: 900,
* height: 250
* }).setup().run()
*
*
* // Create a button
* let button = new Button({
* label: 'Click me',
@@ -1464,7 +1464,7 @@ import {InteractivePopup} from './popup.js'
* app.scene.addChild(message)
* }
* })
*
*
* // Add the button to the scene
* app.scene.addChild(button)
*
@@ -1473,10 +1473,9 @@ import {InteractivePopup} from './popup.js'
* @see {@link https://www.iwm-tuebingen.de/iwmbrowser/lib/pixi/message.html|DocTest}
*/
export default class Message extends InteractivePopup {
/**
* Creates an instance of a Message.
*
*
* @constructor
* @param {object} [opts] - An options object to specify to style and behaviour of the message.
* @param {PIXIApp} [opts.app=window.app] - The PIXIApp where this message belongs to.
@@ -1493,32 +1492,34 @@ export default class Message extends InteractivePopup {
* @param {number} [opts.closeDuration=Theme.fast] - The duration in seconds of the closing of the message box.
*/
constructor(opts = {}) {
const theme = Theme.fromString(opts.theme)
opts = Object.assign({}, {
app: window.app,
closeButton: false,
minWidth: 280,
minHeight: 100,
margin: theme.margin,
align: 'right', // left, center, right
verticalAlign: 'top', // top, middle, bottom
duration: 5,
autoClose: true,
closeDuration: theme.fast
}, opts)
opts = Object.assign(
{},
{
app: window.app,
closeButton: false,
minWidth: 280,
minHeight: 100,
margin: theme.margin,
align: 'right', // left, center, right
verticalAlign: 'top', // top, middle, bottom
duration: 5,
autoClose: true,
closeDuration: theme.fast
},
opts
)
super(opts)
}
/**
* Relayouts the position of the message box.
*
*
* @return {Message} Returns the message box for chaining.
*/
layout() {
super.layout()
// horizontal
@@ -1527,10 +1528,11 @@ export default class Message extends InteractivePopup {
this.x = this.opts.margin
break
case 'center':
this.x = (this.opts.app.size.width / 2) - (this.width / 2)
this.x = this.opts.app.size.width / 2 - this.width / 2
break
case 'right':
this.x = this.opts.app.size.width - this.opts.margin - this.width
this.x =
this.opts.app.size.width - this.opts.margin - this.width
break
}
@@ -1540,21 +1542,21 @@ export default class Message extends InteractivePopup {
this.y = this.opts.margin
break
case 'middle':
this.y = (this.opts.app.size.height / 2) - (this.height / 2)
this.y = this.opts.app.size.height / 2 - this.height / 2
break
case 'bottom':
this.y = this.opts.app.size.height - this.opts.margin - this.height
this.y =
this.opts.app.size.height - this.opts.margin - this.height
break
}
}
/**
* Shows the message box.
*
*
* @private
*/
show() {
super.show()
if (this.opts.autoClose) {
@@ -1577,7 +1579,7 @@ export default class Message extends InteractivePopup {
<footer class="content-size">
<div class="footer">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.2</a> on Wed Jul 10 2019 11:54:25 GMT+0200 (Mitteleuropäische Sommerzeit)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Thu Jul 18 2019 12:16:18 GMT+0200 (Mitteleuropäische Sommerzeit)
</div>
</footer>
</div>