מדיה ויקי:Gadget-Cat-a-lot.js: הבדלים בין גרסאות בדף
מ ושוב תודה לקיפודנחש |
|||
| שורה 8: | שורה 8: | ||
// Completely rewritten by DieBuche | // Completely rewritten by DieBuche | ||
// | // | ||
// Modified to work on regular pages instead of files | // Modified to work on regular pages instead of files + Hebrew translation: קיפודנחש | ||
// | // | ||
// READ THIS PAGE IF YOU WANT TO TRANSLATE OR USE THIS ON ANOTHER SITE: | // READ THIS PAGE IF YOU WANT TO TRANSLATE OR USE THIS ON ANOTHER SITE: | ||
| שורה 14: | שורה 14: | ||
// | // | ||
var catALot = { | var catALot = { | ||
apiUrl: wgScriptPath + "/api.php", | |||
searchmode: false, | |||
version: 2. | version: 2.15, | ||
init: function () { | init: function () { | ||
$("body") | $("body") | ||
| שורה 48: | שורה 48: | ||
}, | }, | ||
findAllLabels: function () { | findAllLabels: function () { | ||
this.labels = $('#mw-pages').find('li'); | if (this.searchmode) this.labels = $('#mw-pages').find('li'); | ||
else this.labels = $('#mw-pages').find('li'); | |||
var links = $('#mw-pages').find('li>a'); | |||
var links = $('# | |||
for (var a in links) | for (var a in links) | ||
links[a].href = null; | links[a].href = null; | ||
| שורה 63: | שורה 59: | ||
this.selectedLabels = this.labels.filter('.cat_a_lot_selected'); | this.selectedLabels = this.labels.filter('.cat_a_lot_selected'); | ||
this.selectedLabels.each(function () { | this.selectedLabels.each(function () { | ||
var file = $(this).find('a[title]') | var file = $(this).find('a[title]'); | ||
marked.push([file.attr('title'), $(this)]); | |||
}); | }); | ||
return marked; | return marked; | ||
| שורה 422: | שורה 416: | ||
document.body.style.cursor = 'auto'; | document.body.style.cursor = 'auto'; | ||
//Reset width | //Reset width | ||
$('#cat_a_lot').width(''); | |||
$('#cat_a_lot').width( $('#cat_a_lot').width() * 1.05 ); | |||
}, | }, | ||
| שורה 462: | שורה 452: | ||
this.makeClickable(); | this.makeClickable(); | ||
$("#cat_a_lot_data").show(); | $("#cat_a_lot_data").show(); | ||
$('#cat_a_lot').resizable({ handles: 'n', | $('#cat_a_lot') | ||
.resizable({ handles: 'n', resize: function(event, ui) {$(this).css({left:"", top:""});} }); | |||
if (this.searchmode) this.updateCats("Pictures and images"); | if (this.searchmode) this.updateCats("Pictures and images"); | ||
else this.updateCats(wgTitle); | else this.updateCats(wgTitle); | ||
| שורה 480: | שורה 466: | ||
}, | }, | ||
i18n: (wgUserLanguage == "he") ? { | i18n: (wgUserLanguage == "he") ? { | ||
loading : 'טוען...', | loading : 'טוען...', | ||
editing : 'עורך דף', | editing : 'עורך דף', | ||