מדיה ויקי:Gadget-CustomSideBarLinks.js: הבדלים בין גרסאות בדף
מ תקלדה |
סידור רווחים |
||
| שורה 3: | שורה 3: | ||
$(function(){ | $(function(){ | ||
function createCustomNav(linkstext) | function createCustomNav(linkstext) { | ||
{ | |||
if (mw.config.get('skin') == 'vector') { | if (mw.config.get('skin') == 'vector') { | ||
var linksPortalName = 'myLinksPortal'; | var linksPortalName = 'myLinksPortal'; | ||
var div = $('<div>', { id: linksPortalName } ).addClass('portal'); | var div = $('<div>', { id: linksPortalName } ).addClass('portal'); | ||
$('#mw-panel > div.portal:eq(0)').after( | $('#mw-panel > div.portal:eq(0)').after(div | ||
.append($('<h3>').text('הקישורים שלי')) | |||
.append($('<div>', {'class': 'body'}).html(linkstext)) | |||
); | |||
$( document ).trigger( 'new-portlet-link', [linksPortalName] ); | $( document ).trigger( 'new-portlet-link', [linksPortalName] ); | ||
return; | return; | ||
| שורה 18: | שורה 16: | ||
var aLink1 = $('<a href="#">הקישורים שלי</a>'); | var aLink1 = $('<a href="#">הקישורים שלי</a>'); | ||
aLink1.click(function(){ | aLink1.click(function(){ | ||
$('#p-customBody1').toggle(); | |||
return false; | |||
}); | }); | ||
var h3CustomTitle = $('<h3>').append(aLink1); | var h3CustomTitle = $('<h3>').append(aLink1); | ||
| שורה 29: | שורה 27: | ||
divCustomBody.addClass(pCom.find('div').attr('class')); | divCustomBody.addClass(pCom.find('div').attr('class')); | ||
navCustomMain.insertBefore(pCom); | navCustomMain.insertBefore(pCom); | ||
} | } | ||
$.ajax({ | |||
url: mw.util.wikiScript('index'), | |||
data: { | |||
title: 'משתמש:' + mw.config.get('wgUserName') + '/הקישורים שלי', | |||
action: 'render' | |||
}, | |||
success: createCustomNav | |||
}); | |||
}); | }); | ||