מדיה ויקי:Gadget-Cat-a-lot.js: הבדלים בין גרסאות בדף

מ ושוב תודה לקיפודנחש
מ ביטול גרסה 10591878 של Matanya (שיחה)
שורה 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:  
שורה 14: שורה 14:
//
//
var catALot = {
var catALot = {
apiUrl: wgScriptPath + "/api.php",
    apiUrl: wgScriptPath + "/api.php",
searchmode: false,
    searchmode: false,
version: 2.18,
version: 2.15,
setHeight: 450,
 
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');
var subCats = $('#mw-subcategories').find('.CategoryTreeItem');
else this.labels = $('#mw-pages').find('li');
for (var sub = 0; sub < subCats.length; sub++)
var links = $('#mw-pages').find('li>a');
subCats[sub]['subcat'] = 1;
$.extend(this.labels, subCats);
var links = $('#bodyContent').find('li>a');
$.extend(links, $('#bodyContent').find('.CategoryTreeLabel'));
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]') && $(this).find('a[title]').attr('title');
var file = $(this).find('a[title]');
file = file || $(this).find('a')[0].innerHTML;
marked.push([file.attr('title'), $(this)]);
var extra = this['subcat'] ? catALot.localCatName + ':' : '';
marked.push([extra + file, $(this)]);
});
});
return marked;
return marked;
שורה 422: שורה 416:
document.body.style.cursor = 'auto';
document.body.style.cursor = 'auto';
         //Reset width
         //Reset width
var cat = $('#cat_a_lot');
$('#cat_a_lot').width('');
cat.width('');
$('#cat_a_lot').width( $('#cat_a_lot').width() * 1.05 );
cat.height('');
cat.width( cat.width() * 1.05 );
var list = $('#cat_a_lot_category_list');
list.css({maxHeight: this.setHeight+'px', height: ''});
},
},


שורה 462: שורה 452:
this.makeClickable();
this.makeClickable();
$("#cat_a_lot_data").show();
$("#cat_a_lot_data").show();
$('#cat_a_lot').resizable({ handles: 'n', alsoResize: '#cat_a_lot_category_list',
$('#cat_a_lot')
resize: function(event, ui) {
  .resizable({ handles: 'n', resize: function(event, ui) {$(this).css({left:"", top:""});} });
$(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);
שורה 480: שורה 466:
},
},
i18n: (wgUserLanguage == "he") ? {
i18n: (wgUserLanguage == "he") ? {
//Progress
loading        : 'טוען...',
loading        : 'טוען...',
editing        : 'עורך דף',
editing        : 'עורך דף',