Widget:Mymodules: verschil tussen versies
Naar navigatie springen
Naar zoeken springen
Geen bewerkingssamenvatting |
Geen bewerkingssamenvatting |
||
Regel 14: | Regel 14: | ||
</noinclude><includeonly><div id="mymodules"></div> | </noinclude><includeonly><div id="mymodules"></div> | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
function make_modules_table(data) { | |||
// data: array of objects; per object: | |||
var html = "<th> <td> Page </td> <td> kind </td> <td> time </td> </th>\n"; | |||
data.forEach( (obj) => { | |||
html = html + "<tr>" + | |||
"<td>" + data.pageName + "</td>" + | |||
"<td>" + data.kind + "</td>" + | |||
"<td>" + data.time + "</td> + | |||
"</tr>\n"; | |||
}); | |||
html = '<table class="wikitable">' + html + "</table>"; | |||
} | |||
function get_mymodules(dest) { | function get_mymodules(dest) { | ||
$.get("https://transparent-spruce.glitch.me/users/" + mw.config.get("wgUserId") + "/events", (res) => { | $.get("https://transparent-spruce.glitch.me/users/" + mw.config.get("wgUserId") + "/events", (res) => { | ||
console.log(res); | console.log(res); | ||
dest. | dest.innerHTML = make_modules_table(JSON.parse(res)); | ||
}); | }); | ||
} | } |
Versie van 30 dec 2019 10:41
This widget given an overview of your module status
Created by User:Eelco
Using this widget
For information on how to use this widget, see ???
text= kind= (string/identifier)
Copy to your site
To use this widget on your site, just install MediaWiki Widgets extension and copy the full source code of this page to your wiki as page Widget:Mymodules.