WIP: Aureplop/kpsul js refactor #501

Draft
delobell wants to merge 215 commits from aureplop/kpsul_js_refactor into master
Showing only changes of commit 034a661444 - Show all commits

View file

@ -370,6 +370,8 @@ var authDialog = new UserDialog({
'content': '<div class="capslock"><span class="glyphicon glyphicon-lock"></span><input type="password" name="password" autofocus><div>', 'content': '<div class="capslock"><span class="glyphicon glyphicon-lock"></span><input type="password" name="password" autofocus><div>',
}); });
//Note/TODO: the returned ajax object can be improved by allowing chaining on errors 403/400
function api_with_auth(settings, password) { function api_with_auth(settings, password) {
if (window.api_lock == 1) if (window.api_lock == 1)
return false; return false;
@ -418,7 +420,7 @@ function api_with_auth(settings, password) {
}); });
} }
String.prototype.pluralize = function(count, irreg_plural = false) { String.prototype.pluralize = function(count, irreg_plural) {
if (Math.abs(count) >= 2) if (Math.abs(count) >= 2)
return irreg_plural ? irreg_plural : this+'s' ; return irreg_plural ? irreg_plural : this+'s' ;
return this ; return this ;