מדיה ויקי:Gadget-FlowDeluxeLocal.js: הבדלים בין גרסאות בדף
אין תקציר עריכה |
מ 34 גרסאות של הדף wikipedia:he:מדיה_ויקי:Gadget-FlowDeluxeLocal.js יובאו |
||
| (5 גרסאות ביניים של 2 משתמשים אינן מוצגות) | |||
| שורה 2: | שורה 2: | ||
// Documentation complète : https://www.mediawiki.org/wiki/Help:Structured_Discussions/FlowDeluxe | // Documentation complète : https://www.mediawiki.org/wiki/Help:Structured_Discussions/FlowDeluxe | ||
$(function() { | $(function() { | ||
var flowDeluxeButtonsInline = typeof window.flowDeluxeButtonsInline !== 'undefined' ? | var flowDeluxeButtonsInline = typeof window.flowDeluxeButtonsInline !== | ||
'undefined' ? | |||
window.flowDeluxeButtonsInline : true; | window.flowDeluxeButtonsInline : true; | ||
function indentPostWithColors() { | function indentPostWithColors() { | ||
var posts = $('.flow-post-main'); | var posts = $('.flow-post-main'); | ||
var colored = true; | var colored = true; | ||
for (var i=0, len=posts.length; i<len; i++) { | for (var i = 0, len = posts.length; i < len; i++) { | ||
if (colored) | if (colored) | ||
$(posts[[i]]).addClass('flow-color-indent'); | $(posts[[i]]) | ||
.addClass('flow-color-indent'); | |||
else | else | ||
$(posts[[i]]).removeClass('flow-color-indent'); | $(posts[[i]]) | ||
.removeClass('flow-color-indent'); | |||
colored = !colored; | colored = !colored; | ||
} | } | ||
} | } | ||
function buttonsInline() { | 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; | var grandParentItem = parentItem.parentElement; | ||
grandParentItem.insertBefore(elements[i],null); | grandParentItem.insertBefore(elements[i], null); | ||
elements[i].className = elements[i].className + | elements[i].className = elements[i].className + ' moved-flow-list'; | ||
elements[i].style.fontSize= | elements[i].style.fontSize = '13px'; | ||
var li = elements[i]. | var sections = $(elements[i]) | ||
for(j=0; j<li.length; j++) { | .find('section'); | ||
li[j].style.display= | for (var j = 0; j < sections.length; j++) | ||
li[j]. | sections[j].style.display = 'inline'; | ||
li[j]. | |||
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(); | parentItem.remove(); | ||
} | |||
} | |||
} | } | ||
function applyChanges() { | function applyChanges() { | ||
indentPostWithColors(); | |||
if (flowDeluxeButtonsInline) | |||
buttonsInline(); | |||
setTimeout(applyChanges, 2000); | |||
} | } | ||
if ( | if ($('.flow-component') | ||
.length) | |||
} | applyChanges(); | ||
}); | |||