Widget:Mybutton: verschil tussen versies
Naar navigatie springen
Naar zoeken springen
(Nieuwe pagina aangemaakt met '<noinclude>__NOTOC__ This widget allows you to embed '''[https://www.disqus.com/ DISQUS Comments]''' on your wiki page. Created by [https://www.mediawikiwidgets.or...') |
Geen bewerkingssamenvatting |
||
(12 tussenliggende versies door dezelfde gebruiker niet weergegeven) | |||
Regel 1: | Regel 1: | ||
<noinclude>__NOTOC__ | <noinclude>__NOTOC__ | ||
This widget allows you to embed | This widget allows you to embed a button on your wiki page. | ||
Created by | Created by User:Eelco | ||
== Using this widget == | == Using this widget == | ||
For information on how to use this widget, see | For information on how to use this widget, see ??? | ||
text= | |||
kind= (string/identifier) | |||
Issues: | |||
* multiple buttons per page are allowed, but only one of the same kind per page | |||
* (multiple buttons of the same kind are not useful, anyway) | |||
* | |||
== 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>< | </noinclude><includeonly><button id="mybutton-<!--{$kind}-->"><!--{$text}--></button> | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
function button_<!--{$kind}-->_handler(evt) { | |||
evt.stopPropagation(); | |||
console.log("Button - Username: " + mw.config.get("wgUserName")); | |||
data = {}; | |||
data.kind = "<!--{$kind}-->"; // "start" or "stop" | |||
data.userid = mw.config.get("wgUserId"); | |||
data.pageid = mw.config.get("wgArticleId"); | |||
data.pagename = mw.config.get("wgPageName"); | |||
$.post("https://transparent-spruce.glitch.me/events", data, (res) => {console.log(res);}); | |||
} | |||
document.getElementById("mybutton-<!--{$kind}-->").onclick = button_<!--{$kind}-->_handler; | |||
</script> | </script> | ||
<noscript>Please enable JavaScript | <noscript>Please enable JavaScript. </noscript></includeonly> | ||
Huidige versie van 29 dec 2019 om 17:21
This widget allows you to embed a button on your wiki page.
Created by User:Eelco
Using this widget
For information on how to use this widget, see ???
text= kind= (string/identifier)
Issues:
- multiple buttons per page are allowed, but only one of the same kind per page
- (multiple buttons of the same kind are not useful, anyway)
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:Mybutton.