User:Huawei251/common.js: Difference between revisions
no edit summary
No edit summary |
No edit summary |
||
Line 7:
// TODO
// 2. 允许循环往复
// 3. 检查无脚本模式和移动端效果
Line 14 ⟶ 13:
* Skrypt dla Szablon:Galeria
*/
mw.loader.using(['oojs-ui-core', 'ext.gadget.site-lib']).then(function () {
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) {▼
console.log('group ' + i);
var unitnode =
if (unitnode === undefined) {
console.log('A');
return 1;
}
var units =
var count = units.get().length;
if (count <= 1) {
Line 35 ⟶ 36:
units.each(function(j, currentimage) {
console.log('unit ' + j);
framed: false,
leftlink.text('◀').click(function() {▼
icon: 'previous',
toggleImage(i, j, j - 1); return false;▼
label: wgULS('上一个', '上一個'),
});▼
invisibleLabel: true,
title: wgULS('上一个', '上一個')
var rightlink = new OO.ui.ButtonWidget({
framed: false,
icon: 'next',
label: wgULS('下一个', '下一個'),
invisibleLabel: true,
title: wgULS('下一个', '下一個')
var label = new OO.ui.ButtonWidget( {
framed: false,
disabled: true,
});
});
});
leftlink.setDisabled(true);
} else if (j === count - 1) {
rightlink.setDisabled(true);
}
▲ rightlink.text('▶').click(function() {
.append(leftlink.$element)▼
▲ toggleImage(i, j, j + 1); return false;
▲ });
.append(rightlink.$element)
▲ }
if (j !== 0) {
▲ .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');
}
});
});
});
});
|