Difference between revisions of "Widget:SpaceAPI"
(added category) |
(innerText (legacy) to textContent) |
||
Line 85: | Line 85: | ||
SpaceState.prototype._fetchSpaceState = function( ) | SpaceState.prototype._fetchSpaceState = function( ) | ||
{ | { | ||
− | this._node. | + | this._node.textContent += "."; |
var xhr = new XMLHttpRequest( ); | var xhr = new XMLHttpRequest( ); | ||
if ( !!( "onload" in xhr ) ) | if ( !!( "onload" in xhr ) ) | ||
Line 118: | Line 118: | ||
SpaceState.prototype._updateSpaceState = function( _message, _color, _title ) | SpaceState.prototype._updateSpaceState = function( _message, _color, _title ) | ||
{ | { | ||
− | this._node. | + | this._node.textContent = _message; |
this._node.style.backgroundColor = _color; | this._node.style.backgroundColor = _color; | ||
if ( _title ) | if ( _title ) |
Revision as of 15:58, 9 September 2015
This widget allows you to display the Space API data (provided as JSON)
Created by Xopr
Using this widget
To insert this widget, use the following code:
{{#widget:SpaceAPI |url=https://ackspace.nl/spaceAPI/ |width=260px |height=20px |padding=8px |interval=20 |float=right }}
This will give the following result:
Note that url is mandatory, the rest is optional (leave out interval to make the data static). Also, you must provide a unit for the sizes (i.e. px, %, etc.)
Copy to your site
To use this widget on your site, just install MediaWiki Widgets extension and copy full source code of this page to your wiki as Widget:SpaceAPI article.