User:Huawei251/common.js: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 1:
// <pre>
 
 
/**
* Skrypt dla Szablon:Galeria
*/
function toggleImage (group, remindex, shwindex) {
jQuery("#ImageGroupsGr" + group + "Im" + remindex).hide();
jQuery("#ImageGroupsGr" + group + "Im" + shwindex).show();
}
function ImageGroup() {
jQuery('div.ImageGroup').each(function(i, group) {
var unitnode = jQuery('div.ImageGroupUnits', group).get(0);
if (unitnode == undefined) {
return 1;
}
var units = jQuery(unitnode).children('.center');
var count = units.get().length;
if (count <= 1) {
return 1;
}
units.each(function(j, currentimage) {
jQuery(currentimage).attr('id', "ImageGroupsGr" + i + "Im" + j);
var leftlink = jQuery('<a href="#"/>');
if (j != 0) {
leftlink.text('◀').click(function() {
toggleImage(i, j, j - 1); return false;
});
}
var rightlink = jQuery('<a href="#"/>');
if (j != count - 1) {
rightlink.text('▶').click(function() {
toggleImage(i, j, j + 1); return false;
});
}
jQuery('<div/>').css({ 'font-size' : '110%', 'font-weight' : 'bold' })
.addClass('disabled-user-selection')
.append(leftlink)
.append('<tt>(' + (j + 1) + '/' + count + ')</tt>')
.append(rightlink)
.prependTo(jQuery(currentimage));
if (j != 0) {
jQuery(currentimage).hide().addClass('noprint');
}
});
});
}
jQuery(ImageGroup);
 
 
 
// Wikiplus blocked by this site
229

edits