מדיה ויקי:Gadget-Cat-a-lot.js: הבדלים בין גרסאות בדף
←using [[mw:CodeEditor|CodeEditor]]: פיינשמקר |
←using [[mw:CodeEditor|CodeEditor]]: white-space damage, nitpicking. |
||
| שורה 14: | שורה 14: | ||
// | // | ||
var catALot = { | var catALot = { | ||
apiUrl: wgScriptPath + "/api.php", | |||
searchmode: false, | searchmode: false, | ||
version: 2.18, | version: 2.18, | ||
| שורה 26: | שורה 26: | ||
if (!this.searchmode) $('#cat_a_lot_selections').append('<br><a id="cat_a_lot_remove"><b>' + this.i18n.removeFromCat + '</b></a>'); | if (!this.searchmode) $('#cat_a_lot_selections').append('<br><a id="cat_a_lot_remove"><b>' + this.i18n.removeFromCat + '</b></a>'); | ||
$('#cat_a_lot_remove').click(function () { | $('#cat_a_lot_remove').click(function () { | ||
catALot.remove(); | catALot.remove(); | ||
| שורה 43: | שורה 39: | ||
catALot.run(); | catALot.run(); | ||
}); | }); | ||
$('#cat_a_lot_searchcatname') | |||
$('#cat_a_lot_searchcatname').autocomplete({ | .keypress(function (e) { | ||
if (e.which == 13) | |||
catALot.updateCats($(this).val()); | |||
}) | |||
.autocomplete({ | |||
source: function(request, response) { | |||
catALot.doAPICall({action:'opensearch', search: request.term, namespace: 14}, | |||
function(data){ | |||
if(data[1]) | |||
response($(data[1]).map(function(index,item){return item.replace(/.*:/, '');})); | |||
} | |||
); | |||
}, | |||
open:function(){ | |||
$(".ui-autocomplete") | |||
.position({ | |||
my: "left bottom", | |||
at: "left top", | |||
of: $('#cat_a_lot_searchcatname') | |||
}); | |||
} | |||
}); | }); | ||
importStylesheet('MediaWiki:Gadget-Cat-a-lot.css'); | importStylesheet('MediaWiki:Gadget-Cat-a-lot.css'); | ||
| שורה 167: | שורה 167: | ||
}, | }, | ||
regexBuilder: function (category) { | regexBuilder: function (category) { | ||
var catname = ( this.localCatName == 'Category' ) ? this.localCatName : this.localCatName + '|Category'; | var catname = ( this.localCatName == 'Category' ) ? this.localCatName: this.localCatName + '|Category'; | ||
catname = '(' + catname + ')'; | catname = '(' + catname + ')'; | ||
| שורה 277: | שורה 277: | ||
}; | }; | ||
var isBot=$.inArray('bot', wgUserGroups)>-1; | |||
if(isBot) | |||
data.bot = '1'; | |||
this.doAPICall(data, function (ret) { | this.doAPICall(data, function (ret) { | ||
catALot.updateCounter(); | catALot.updateCounter(); | ||
| שורה 503: | שורה 503: | ||
i18n: (wgUserLanguage == "he") ? { | i18n: (wgUserLanguage == "he") ? { | ||
//Progress | //Progress | ||
loading | loading: 'טוען...', | ||
editing | editing: 'עורך דף', | ||
of | of: 'מתוך ', | ||
skippedAlready : '<h5>הדפים להלן לא שונו, משום שכבר הכילו את הקטגוריה:</h5>', | skippedAlready: '<h5>הדפים להלן לא שונו, משום שכבר הכילו את הקטגוריה:</h5>', | ||
skippedNotFound: '<h5>הדפים להלן לא שונו, משום שהקטגוריה לא נמצאה:</h5>', | skippedNotFound: '<h5>הדפים להלן לא שונו, משום שהקטגוריה לא נמצאה:</h5>', | ||
skippedServer | skippedServer: '<h5>Tהדפים להלן לא שונו, בגלל בעית תקשורת/h5>', | ||
allDone | allDone: 'כל הדפים שונו.', | ||
done | done: 'בוצע!', | ||
addedCat | addedCat: 'קטגוריה התווספה', | ||
copiedCat | copiedCat: 'קטגוריה התווספה', | ||
movedCat | movedCat: 'הועברו לקטגוריה', | ||
removedCat | removedCat: 'הוסרו מקטגוריה', | ||
returnToPage | returnToPage: 'חזור לדף', | ||
catNotFound : 'קטגוריה לא נמצאה.', | catNotFound: 'קטגוריה לא נמצאה.', | ||
//as in 17 files selected | //as in 17 files selected | ||
filesSelected | filesSelected: ' דפים מסומנים.', | ||
//Actions | //Actions | ||
copy | copy: 'הוסף', | ||
move | move: 'העבר', | ||
add | add: 'הוסף', | ||
removeFromCat | removeFromCat: 'הסרה מקטגוריה זו', | ||
enterName | enterName: 'שם קטגוריה להוספה לרשימה', | ||
select | select: 'בחירה', | ||
all | all: 'כולם', | ||
none | none: 'נקה', | ||
noneSelected : 'אין דפים מסומנים!', | noneSelected: 'אין דפים מסומנים!', | ||
//Summaries: | //Summaries: | ||
summaryAdd | summaryAdd: 'Cat-a-lot: הוסיף ל[[קטגוריה:', | ||
summaryCopy | summaryCopy: 'Cat-a-lot: העתיק מ[[קטגוריה:', | ||
to | to: 'ל[[קטגוריה:', | ||
summaryMove | summaryMove: 'Cat-a-lot: העביר מ[[קטגוריה:', | ||
summaryRemove | summaryRemove: 'Cat-a-lot: הסיר מ[[קטגוריה:' | ||
} : { | }: { | ||
//Progress | //Progress | ||
loading | loading: 'Loading...', | ||
editing | editing: 'Editing page', | ||
of | of: 'of ', | ||
skippedAlready : '<h5>The following pages were skipped, because the page was already in the category:</h5>', | skippedAlready: '<h5>The following pages were skipped, because the page was already in the category:</h5>', | ||
skippedNotFound: '<h5>The following pages were skipped, because the old category could not be found:</h5>', | skippedNotFound: '<h5>The following pages were skipped, because the old category could not be found:</h5>', | ||
skippedServer | skippedServer: '<h5>The following pages couldn\'t be changed, since there were problems connecting to the server:</h5>', | ||
allDone | allDone: 'All pages are processed.', | ||
done | done: 'Done!', | ||
addedCat | addedCat: 'Added category', | ||
copiedCat | copiedCat: 'Copied to category', | ||
movedCat | movedCat: 'Moved to category', | ||
removedCat | removedCat: 'Removed from category', | ||
returnToPage | returnToPage: 'Return to page', | ||
catNotFound : 'Category not found.', | catNotFound: 'Category not found.', | ||
//as in 17 files selected | //as in 17 files selected | ||
filesSelected | filesSelected: ' files selected.', | ||
//Actions | //Actions | ||
copy | copy: 'Copy', | ||
move | move: 'Move', | ||
add | add: 'Add', | ||
removeFromCat | removeFromCat: 'Remove from this category', | ||
enterName | enterName: 'Enter category name', | ||
select | select: 'Select', | ||
all | all: 'all', | ||
none | none: 'none', | ||
noneSelected : 'No files selected!', | noneSelected: 'No files selected!', | ||
//Summaries: | //Summaries: | ||
summaryAdd | summaryAdd: 'Cat-a-lot: Adding [[Category:', | ||
summaryCopy | summaryCopy: 'Cat-a-lot: Copying from [[Category:', | ||
to | to: 'to [[Category:', | ||
summaryMove | summaryMove: 'Cat-a-lot: Moving from [[Category:', | ||
summaryRemove | summaryRemove: 'Cat-a-lot: Removing from [[Category:' | ||
} | } | ||
}; | }; | ||