מדיה ויקי:Tabs.js: הבדלים בין גרסאות בדף

תוכן שנמחק תוכן שנוסף
ערן (שיחה | תרומות)
מאין תקציר עריכה
ערן (שיחה | תרומות)
מאין תקציר עריכה
שורה 140:
customTabsLoad(i);
}
 
});
 
//tabs2
mw.hook( 'wikipage.content' ).add( function ( $content ) {
if($content.find('.tabWrapper').length === 0) return;
mw.loader.using( 'jquery.ui.tabs', function () {
$content.find('.tabWrapper').each(function () {
var options = $('.tabWrapperOptions', this).text();
 
var tabBackground = options.match(/tabBackground:(.*?);/)[1];
var tabBorder = options.match(/tabBorder:(.*?);/)[1];
var defaultTab = options.match(/defaultTab:(.*?);/)[1];
 
$(this).tabs({
selected: defaultTab
});
if (tabBackground) {
var tabs = $('.ui-tabs-nav li a', this);
tabs.css('background', tabBackground)
$(this).bind('tabsselect', function (e, ui) {
tabs.css('background', tabBackground);
$(ui.tab).css('background', '#ffffff');
});
$(tabs.get(defaultTab)).css('background', '#ffffff');
}
if (tabBorder) {
$(this).css('border-color', tabBorder);
}
$content.find('.tabWrapper .ui-widget-content,.tabWrapper.ui-widget-content').removeClass('ui-widget-content');
})
});
});
 
$(this).tabs({
selected: defaultTab
});
if (tabBackground) {
var tabs = $('.ui-tabs-nav li a', this);
tabs.css('background', tabBackground);
$(this).bind('tabsselect', function (e, ui) {
tabs.css('background', tabBackground);
$(ui.tab).css('background', '#ffffff');
});
$(tabs.get(defaultTab)).css('background', '#ffffff');
}
if (tabBorder) {
$(this).css('border-color', tabBorder);
}
$content.find('.tabWrapper .ui-widget-content,.tabWrapper.ui-widget-content').removeClass('ui-widget-content');
})
});
});