Widget:Slides

Infrastructure for wiki-based "slide" presentations, based on html5slides. /*<![CDATA[*/ $(function {  function weSlideShow {    $.getScript(wgServer + '/extensions/WE/Slides/slides.js');    $('#WEslides').remove;    $('.mw-editsection').remove;    return false;  }

var weAPI = wgServer + '/api.php'; var narration;

$.each($('div.slides').attr('class').split(/\s+/), function(i, v) {   if (v.indexOf('narration:') === 0) {      narration = v.substr('narration:'.length).replace(',', '|');    }  }); if (narration !== undefined) { $.ajax({     url: weAPI,      data: {        action: 'query',        format: 'json',        prop: 'imageinfo',        iiprop: 'url',        titles: narration      },      async: true,      dataType: 'json',      type: 'POST',      success: function(data) {        var i, u;        var audiotag = ' ';        if (data && 'query' in data && 'pages' in data.query) {          for (i in data.query.pages) {            u = data.query.pages[i].imageinfo[0].url;            type = (u.substr(-3) === 'mp3') ? 'mpeg' : 'ogg';            audiotag += '';          }        }        audiotag += ' ';        $('#WEslides').before(audiotag);      }    }); }

if (window.location.search.indexOf('present') >= 0) { weSlideShow; } else { $('#WEslides').html(' '); $('#WEslides > input').click(weSlideShow); } }); /*]]>*/