מדיה ויקי:Gadget-FlowDeluxeLocal.js – הבדלי גרסאות
תוכן שנמחק תוכן שנוסף
אין תקציר עריכה |
מאין תקציר עריכה |
||
שורה 63: | שורה 63: | ||
.length) |
.length) |
||
applyChanges(); |
applyChanges(); |
||
} |
}); |
גרסה אחרונה מ־00:56, 23 במרץ 2018
// Created by User:FlowDeluxe from frwiki and localized here.
// Documentation complète : https://www.mediawiki.org/wiki/Help:Structured_Discussions/FlowDeluxe
$(function() {
var flowDeluxeButtonsInline = typeof window.flowDeluxeButtonsInline !==
'undefined' ?
window.flowDeluxeButtonsInline : true;
function indentPostWithColors() {
var posts = $('.flow-post-main');
var colored = true;
for (var i = 0, len = posts.length; i < len; i++) {
if (colored)
$(posts[[i]])
.addClass('flow-color-indent');
else
$(posts[[i]])
.removeClass('flow-color-indent');
colored = !colored;
}
}
function buttonsInline() {
var elements = $('.flow-list');
for (var i = 0, len = elements.length; i < len - 1; i++) {
if (elements[i].className.indexOf('moved-flow-list') < 0 &&
elements[i].innerHTML.indexOf('flow-ui-summarize-topic-link') > 0) {
var parentItem = elements[i].parentElement;
var grandParentItem = parentItem.parentElement;
grandParentItem.insertBefore(elements[i], null);
elements[i].className = elements[i].className + ' moved-flow-list';
elements[i].style.fontSize = '13px';
var sections = $(elements[i])
.find('section');
for (var j = 0; j < sections.length; j++)
sections[j].style.display = 'inline';
var li = $(elements[i])
.find('li');
for (j = 0; j < li.length; j++) {
li[j].style.display = 'inline';
$(li[j])
.find('a')[0].style.paddingLeft = '10px';
$(li[j])
.find('a')[0].style.paddingRight = '0';
}
parentItem.remove();
}
}
}
function applyChanges() {
indentPostWithColors();
if (flowDeluxeButtonsInline)
buttonsInline();
setTimeout(applyChanges, 2000);
}
if ($('.flow-component')
.length)
applyChanges();
});