מדיה ויקי: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(){ | $(document).ready(function(){ | ||
function createCustomNav(linkstext) | function createCustomNav(linkstext) | ||
{ | { | ||
var aLink1 = | var aLink1 = $('<a href="#">הקישורים שלי</a>'); | ||
aLink1. | aLink1.click(function(){ | ||
$('#p-customBody1').toggle(); | |||
return false; | |||
var h5CustonTitle = | }); | ||
var h5CustonTitle = $('<h5>').append(aLink1); | |||
var divCustonBody = $('<div id="p-customBody1" style="display:none;"></div>'); | |||
divCustonBody.html(linkstext); | |||
var navCustonMain = $('<div></div>').append(h5CustonTitle).append(divCustonBody); | |||
var pCom = $('#p-community'); | |||
navCustonMain.addClass(pCom.attr('class')); | |||
divCustonBody.addClass(pCom.find('div').attr('class')); | |||
navCustonMain.insertBefore(pCom); | |||
var navCustonMain = | |||
var pCom = | |||
navCustonMain. | |||
divCustonBody. | |||
} | } | ||
גרסה מ־20:43, 4 באוקטובר 2011
// הסקריפט מוסיף קישורים (שנבחרו על ידי המשתמש) לתיבה שממוקמת מעל לתיבת הקהילה.
// created by [[user:Yonidebest]] with some help from [[User:ערן]]
$(document).ready(function(){
function createCustomNav(linkstext)
{
var aLink1 = $('<a href="#">הקישורים שלי</a>');
aLink1.click(function(){
$('#p-customBody1').toggle();
return false;
});
var h5CustonTitle = $('<h5>').append(aLink1);
var divCustonBody = $('<div id="p-customBody1" style="display:none;"></div>');
divCustonBody.html(linkstext);
var navCustonMain = $('<div></div>').append(h5CustonTitle).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.user.name()+'/הקישורים שלי',
action: 'render'
}, success: createCustomNav
});
});