מדיה ויקי:Gadget-Cat-a-lot.js: הבדלים בין גרסאות בדף
מ נסיון חוזר |
|||
| שורה 8: | שורה 8: | ||
// Completely rewritten by DieBuche | // Completely rewritten by DieBuche | ||
// | // | ||
// Modified to work on regular pages instead of files + Hebrew translation: קיפודנחש | // 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: | ||
| שורה 15: | שורה 15: | ||
var catALot = { | var catALot = { | ||
apiUrl: wgScriptPath + "/api.php", | apiUrl: wgScriptPath + "/api.php", | ||
searchmode: false, | |||
version: 2. | version: 2.18, | ||
setHeight: 450, | |||
init: function () { | init: function () { | ||
$("body") | $("body") | ||
| שורה 48: | שורה 48: | ||
}, | }, | ||
findAllLabels: function () { | findAllLabels: function () { | ||
this.labels = $('#mw-pages').find('li'); | |||
var subCats = $('#mw-subcategories').find('.CategoryTreeItem'); | |||
var | for (var sub = 0; sub < subCats.length; sub++) { | ||
var a = $(subCats[sub]).find('a'); | |||
if (a.length) { | |||
a[0]['title'] = catALot.localCatName + ":" + a[0].innerHTML; | |||
this.labels.push(subCats[sub]); | |||
} | |||
} | |||
$('#bodyContent').find('li>a, .CategoryTreeLabel').each(function(){this.href = null;}); | |||
}, | }, | ||
| שורה 416: | שורה 421: | ||
document.body.style.cursor = 'auto'; | document.body.style.cursor = 'auto'; | ||
//Reset width | //Reset width | ||
$('#cat_a_lot').width(''); | var cat = $('#cat_a_lot'); | ||
cat.width(''); | |||
cat.height(''); | |||
cat.width( cat.width() * 1.05 ); | |||
var list = $('#cat_a_lot_category_list'); | |||
list.css({maxHeight: this.setHeight+'px', height: ''}); | |||
}, | }, | ||
| שורה 452: | שורה 461: | ||
this.makeClickable(); | this.makeClickable(); | ||
$("#cat_a_lot_data").show(); | $("#cat_a_lot_data").show(); | ||
$('#cat_a_lot') | $('#cat_a_lot').resizable({ handles: 'n', alsoResize: '#cat_a_lot_category_list', | ||
resize: function(event, ui) { | |||
$(this).css({left:"", top:""}); | |||
catALot.setHeight = $(this).height(); | |||
$('#cat_a_lot_category_list').css({maxHeight: '', width: ''}); | |||
} }); | |||
$('#cat_a_lot_category_list').css({maxHeight: '450px'}); | |||
if (this.searchmode) this.updateCats("Pictures and images"); | if (this.searchmode) this.updateCats("Pictures and images"); | ||
else this.updateCats(wgTitle); | else this.updateCats(wgTitle); | ||
| שורה 466: | שורה 479: | ||
}, | }, | ||
i18n: (wgUserLanguage == "he") ? { | i18n: (wgUserLanguage == "he") ? { | ||
//Progress | |||
loading : 'טוען...', | loading : 'טוען...', | ||
editing : 'עורך דף', | editing : 'עורך דף', | ||