מדיה ויקי:Gadget-rollBackSummary.js: הבדלים בין גרסאות בדף
מאין תקציר עריכה |
מאין תקציר עריכה |
||
| שורה 1: | שורה 1: | ||
var slideShowLinks; | var slideShowLinks; | ||
var currentImage; | var currentImage; | ||
function changeSlideShowImage(text) { | |||
var slideshowimage = document.getElementById('slideshowimage'); | |||
var slideshowlinkright = document.getElementById('slideshowlinkright'); | |||
var slideshowlinkleft = document.getElementById('slideshowlinkleft'); | |||
var imagelink = document.getElementById('file').getElementsByTagName('A')[0].href; | |||
} | |||
function toggleSlideShowImage(direction) { | |||
// figure out which image to load | |||
var nextImage = currentImage; | |||
if (direction) // = 1 = up | |||
nextImage++; | |||
else // = 0 = down | |||
nextImage--; | |||
// load image page | |||
var a = sajax_init_object(); | |||
a.open('GET', wgServer + wgScriptPath + '/index.php?title=' + encodeURIComponent(slideShowLinks[nextImage]) + 'action=render', true); | |||
a.onreadystatechange = function() { | |||
if (a.readyState != 4) return; | |||
changeSlideShowImage(a.responseText); | |||
// alert("[" + a.status + ":" + a.statusText + "]\n" + a.responseText); | |||
}; | |||
a.send(null); | |||
} | |||
function initSlideShow() { | function initSlideShow() { | ||
| שורה 16: | שורה 44: | ||
var td1SS = document.createElement('TD'); | var td1SS = document.createElement('TD'); | ||
var img1SS = document.createElement('IMG'); | |||
img1SS.id = 'slideshowimage'; | |||
td1SS.appendChild(img1SS); | |||
var tr1SS = document.createElement('TR'); | var tr1SS = document.createElement('TR'); | ||
tr1SS.appendChild(td1SS); | tr1SS.appendChild(td1SS); | ||
| שורה 29: | שורה 59: | ||
var a2SS = document.createElement('A'); | var a2SS = document.createElement('A'); | ||
a2SS.id = ' | a2SS.id = 'slideshowlinkright'; | ||
a2SS.href = 'javascript:toggleSlideShowImage(0)'; 0 = right/down | a2SS.href = 'javascript:toggleSlideShowImage(0)'; 0 = right/down | ||
a2SS.innerHTML = '<'; | a2SS.innerHTML = '<'; | ||