מדיה ויקי:Gadget-CustomSideBarLinks.js: הבדלים בין גרסאות בדף
מראה
1.19 |
לכבוד wmf5 - התפריטים שונו מ-h5 ל-h3 |
||
| שורה 11: | שורה 11: | ||
$('#mw-panel > div.portal:eq(0)').after( | $('#mw-panel > div.portal:eq(0)').after( | ||
div | div | ||
.append($('< | .append($('<h3>').text('הקישורים שלי')) | ||
.append($('<div>', {'class': 'body'}).css({display: state ? 'block' : 'hidden'}).html(linkstext)) | .append($('<div>', {'class': 'body'}).css({display: state ? 'block' : 'hidden'}).html(linkstext)) | ||
); | ); | ||
| שורה 21: | שורה 21: | ||
return false; | return false; | ||
}); | }); | ||
var | var h3CustonTitle = $('<h3>').append(aLink1); | ||
var divCustonBody = $('<div id="p-customBody1" style="display:none;"></div>'); | var divCustonBody = $('<div id="p-customBody1" style="display:none;"></div>'); | ||
divCustonBody.html(linkstext); | divCustonBody.html(linkstext); | ||
var navCustonMain = $('<div></div>').append( | var navCustonMain = $('<div></div>').append(h3CustonTitle).append(divCustonBody); | ||
var pCom = $('#p-community'); | var pCom = $('#p-community'); | ||
navCustonMain.addClass(pCom.attr('class')); | navCustonMain.addClass(pCom.attr('class')); | ||
גרסה מ־03:03, 6 בדצמבר 2012
// הסקריפט מוסיף קישורים (שנבחרו על ידי המשתמש) לתיבה שממוקמת מעל לתיבת הקהילה.
// created by [[user:Yonidebest]] with some help from [[User:ערן]]
$(document).ready(function(){
function createCustomNav(linkstext)
{
if (mw.config.get('skin') == 'vector' && mw.config.get('wgVectorEnabledModules').collapsiblenav) {
var linksPortalName = 'myLinksPortal';
var state = $.cookie('vector-nav-' + linksPortalName) == 'true';
var div = $('<div>', {'class': 'portal ' + (state ? 'expanded' : 'collapsed'), id: linksPortalName});
$('#mw-panel > div.portal:eq(0)').after(
div
.append($('<h3>').text('הקישורים שלי'))
.append($('<div>', {'class': 'body'}).css({display: state ? 'block' : 'hidden'}).html(linkstext))
);
return;
} // else...
var aLink1 = $('<a href="#">הקישורים שלי</a>');
aLink1.click(function(){
$('#p-customBody1').toggle();
return false;
});
var h3CustonTitle = $('<h3>').append(aLink1);
var divCustonBody = $('<div id="p-customBody1" style="display:none;"></div>');
divCustonBody.html(linkstext);
var navCustonMain = $('<div></div>').append(h3CustonTitle).append(divCustonBody);
var pCom = $('#p-community');
navCustonMain.addClass(pCom.attr('class'));
divCustonBody.addClass(pCom.find('div').attr('class'));
navCustonMain.insertBefore(pCom);
}
$.ajax({
url: mw.util.wikiScript('index'),
data: {
title: 'משתמש:'+mw.config.get('wgUserName')+'/הקישורים שלי',
action: 'render'
},
success: createCustomNav
});
})