Widget:Mybutton: verschil tussen versies

Uit basis
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
Regel 1: Regel 1:
<noinclude>__NOTOC__
<noinclude>__NOTOC__
This widget allows you to embed '''[https://www.disqus.com/ DISQUS Comments]''' on your wiki page.
This widget allows you to embed a button on your wiki page.


Created by [https://www.mediawikiwidgets.org/User:Sergey_Chernyshev Sergey Chernyshev]
Created by User:Eelco


== Using this widget ==
== Using this widget ==
For information on how to use this widget, see [https://www.mediawikiwidgets.org/DISQUS widget description page on MediaWikiWidgets.org].
For information on how to use this widget, see ???
 
id=
 
Issues:
 
* multiple buttons per page are allowed;
* each button on a page must have a unique name (id);
*


== 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="disqus_thread"></div>
</noinclude><includeonly><div id="mybutton-$id"></div>
<script type="text/javascript">
<script type="text/javascript">
     /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
     function button_$id_handler() {
    var disqus_shortname = '<!--{$id|escape:'urlpathinfo'}-->'; // required: replace example with your forum shortname
      $.get("http://www.example.com", (res) => {console.log(res);});
    <!--{if (isset($uniqid))}-->var disqus_identifier = '<!--{$uniqid|escape:'quotes'}-->';<!--{/if}-->
     }
    <!--{if (isset($url))}-->var disqus_url = '<!--{$url|escape:'quotes'}-->';<!--{/if}-->
    document.getElementById("mybutton-$id").onclick = button_$id_handler;
 
    /* * * DON'T EDIT BELOW THIS LINE * * */
    (function() {
        var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
        dsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js';
        (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
     })();
</script>
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<noscript>Please enable JavaScript. </noscript></includeonly>
<a href="https://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a></includeonly>

Versie van 23 dec 2019 20:07

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 ???

id=

Issues:

  • multiple buttons per page are allowed;
  • each button on a page must have a unique name (id);

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.