מדיה ויקי:Gadget-FlowDeluxeLocal.js: הבדלים בין גרסאות בדף
מראה
אין תקציר עריכה |
אין תקציר עריכה |
||
| שורה 30: | שורה 30: | ||
elements[i].style.fontSize= "13px"; | elements[i].style.fontSize= "13px"; | ||
var sections = elements[i]. | var sections = $(elements[i]).find('section'); | ||
for(var j=0; j<sections.length; j++) | for(var j=0; j<sections.length; j++) | ||
sections[j].style.display="inline"; | sections[j].style.display="inline"; | ||
var li = elements[i]. | var li = $(elements[i]).find('li'); | ||
for(j=0; j<li.length; j++) { | for(j=0; j<li.length; j++) { | ||
li[j].style.display="inline"; | li[j].style.display="inline"; | ||
li[j]. | $(li[j]).find('a')[0].style.paddingLeft="10px"; | ||
li[j]. | $(li[j]).find('a')[0].style.paddingRight="0"; | ||
} | } | ||
גרסה מ־11:40, 22 במרץ 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();
})();