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