Diferencia entre revisiones de «Widget:Slides»
(No se muestra una edición intermedia del mismo usuario) | |||
Línea 2: | Línea 2: | ||
<div id="MIslides"></div> | <div id="MIslides"></div> | ||
<script type="text/javascript">/*<![CDATA[*/ | <script type="text/javascript">/*<![CDATA[*/ | ||
− | + | Element.prototype.remove = function() { | |
− | + | this.parentElement.removeChild(this); | |
+ | } | ||
+ | NodeList.prototype.remove = HTMLCollection.prototype.remove = function() { | ||
+ | for(var i = this.length - 1; i >= 0; i--) { | ||
+ | if(this[i] && this[i].parentElement) { | ||
+ | this[i].parentElement.removeChild(this[i]); | ||
+ | } | ||
+ | } | ||
+ | } | ||
− | + | function MIslideshow() { | |
− | mw.loader.load(wgServer + ' | + | mw.loader.load(wgServer + '/extensions/WE/Slides/slides.js'); |
− | + | document.getElementById("MIslides").remove(); | |
− | + | document.getElementsByClassName('mw-editsection').remove(); | |
return false; | return false; | ||
− | } | + | }; |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | function creaSlides() { | ||
if (window.location.search.indexOf('present') >= 0) { MIslideshow(); } else { | if (window.location.search.indexOf('present') >= 0) { MIslideshow(); } else { | ||
− | + | var boton = document.createElement("input"); | |
− | + | boton.setAttribute('type', 'submit'); | |
+ | boton.setAttribute('value', 'Ver presentación'); | ||
+ | boton.setAttribute('href', '#'); | ||
+ | boton.onclick = MIslideshow; | ||
+ | document.getElementById("MIslides").appendChild(boton) | ||
}; | }; | ||
− | } | + | } |
+ | RLQ.push(function () { | ||
+ | creaSlides(); | ||
+ | }); | ||
/*]]>*/</script></includeonly> | /*]]>*/</script></includeonly> |
Revisión actual del 19:24 27 nov 2019
Infrastructure for wiki-based "slide" presentations, based on html5slides. Idea original de Jim Tittsler http://wikieducator.org/index.php?title=Widget:Slide