Widget:Mymodules: verschil tussen versies

Uit basis
Naar navigatie springen Naar zoeken springen
(Nieuwe pagina aangemaakt met '<noinclude>__NOTOC__ This widget given an overview of your module status Created by User:Eelco == Using this widget == For information on how to use this widget,...')
 
Geen bewerkingssamenvatting
 
(19 tussenliggende versies door dezelfde gebruiker niet weergegeven)
Regel 12: Regel 12:
== Copy to your site ==
== Copy to your site ==
To use this widget on your site, just install [https://www.mediawiki.org/wiki/Extension:Widgets MediaWiki Widgets extension] and copy the [{{fullurl:{{FULLPAGENAME}}|action=edit}} full source code] of this page to your wiki as page '''{{FULLPAGENAME}}'''.
To use this widget on your site, just install [https://www.mediawiki.org/wiki/Extension:Widgets MediaWiki Widgets extension] and copy the [{{fullurl:{{FULLPAGENAME}}|action=edit}} full source code] of this page to your wiki as page '''{{FULLPAGENAME}}'''.
</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 = "<tr> <th> Page </th> <th> link </th> <th> kind </th> <th> time </th> </tr>\n";
      var articlePath = mw.config.get("wgArticlePath");
      console.log(typeof data);
      data.forEach( (obj) => {
        html = html + "<tr>" +
              "<td>" + obj.pagename + "</td>" +
              "<td>" + '<a href="' + articlePath.replace('$1', obj.pagename) + '">' + obj.pagename + "</a>" + "</td>" +
              "<td>" + obj.kind + "</td>" +
              "<td>" + obj.time + "</td>" +
              "</tr>\n";
        console.log(html);
      });
      html = '<table class="wikitable">' + html + "</table>";
      return(html);
    }
     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.innertext = res;
         dest.innerHTML = make_modules_table(JSON.parse(res));
       });
       });
     }
     }
     get_mymodules(document.getElementById("mymodules"););
     // get_mymodules(document.getElementById("mymodules"));
   
</script>
</script>
<noscript>Please enable JavaScript. </noscript></includeonly>
</includeonly>

Huidige versie van 9 jan 2020 om 15:06

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.