Merge branch 'janeczku:Develop' into Develop

This commit is contained in:
Purbayan Chowdhury
2024-05-23 01:45:36 +05:30
committed by GitHub
114 changed files with 13596 additions and 10949 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

+5
View File
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="140px" height="140px" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd" xmlns:xlink="http://www.w3.org/1999/xlink">
<g><path style="opacity:1" fill="#45b29d" d="M 70.5,5.5 C 87.7691,3.12603 97.4358,10.4594 99.5,27.5C 95.637,46.6972 84.3037,59.1972 65.5,65C 60.9053,66.3929 56.2387,66.7262 51.5,66C 50.0692,65.5348 48.9025,64.7014 48,63.5C 47.3333,60.5 47.3333,57.5 48,54.5C 62.2513,56.0484 73.5846,50.715 82,38.5C 85.0332,33.8945 86.0332,28.8945 85,23.5C 83.0488,19.2854 79.7155,17.2854 75,17.5C 65.5257,19.0759 57.859,23.7425 52,31.5C 38.306,51.6368 33.9727,73.6368 39,97.5C 44.5639,116.532 56.7306,122.699 75.5,116C 80.6017,113.385 85.2684,110.218 89.5,106.5C 95.1927,108.891 96.6927,112.891 94,118.5C 78.4211,132.151 61.2544,134.651 42.5,126C 31.5182,117.21 25.3516,105.71 24,91.5C 20.9978,65.8515 27.3311,42.8515 43,22.5C 50.6154,14.1193 59.7821,8.45258 70.5,5.5 Z"/></g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

-50
View File
@@ -81,56 +81,6 @@ if ($("body.book").length > 0) {
$(".rating").insertBefore(".hr");
$("#remove-from-shelves").insertAfter(".hr");
$(description).appendTo(".bookinfo")
/* if book description is not in html format, Remove extra line breaks
Remove blank lines/unnecessary spaces, split by line break to array
Push array into .description div. If there is still a wall of text,
find sentences and split wall into groups of three sentence paragraphs.
If the book format is in html format, Keep html, but strip away inline
styles and empty elements */
// If text is sitting in div as text node
if ($(".comments:has(p)").length === 0) {
newdesc = description.text()
.replace(/^(?=\n)$|^\s*|\s*$|\n\n+/gm, "").split(/\n/);
$(".comments").empty();
$.each(newdesc, function (i, val) {
$("div.comments").append("<p>" + newdesc[i] + "</p>");
});
$(".comments").fadeIn(100);
} //If still a wall of text create 3 sentence paragraphs.
if ($(".comments p").length === 1) {
if (description.context != undefined) {
newdesc = description.text()
.replace(/^(?=\n)$|^\s*|\s*$|\n\n+/gm, "").split(/\n/);
} else {
newdesc = description.text();
}
doc = nlp(newdesc.toString());
sentences = doc.map((m) => m.out("text"));
sentences[0] = sentences[0].replace(",", "");
$(".comments p").remove();
let size = 3;
let sentenceChunks = [];
for (var i = 0; i < sentences.length; i += size) {
sentenceChunks.push(sentences.slice(i, i + size));
}
let output = '';
$.each(sentenceChunks, function (i, val) {
let preOutput = '';
$.each(val, function (i, val) {
preOutput += val;
});
output += "<p>" + preOutput + "</p>";
});
$("div.comments").append(output);
} else {
$.each(description, function (i, val) {
// $( description[i].outerHTML ).appendTo( ".comments" );
$("div.comments :empty").remove();
$("div.comments ").attr("style", "");
});
$("div.comments").fadeIn(100);
}
// Sexy blurred backgrounds
cover = $(".cover img").attr("src");
@@ -9,6 +9,7 @@
"wordSequences": "Das Passwort enthält Buchstabensequenzen",
"wordLowercase": "Bitte mindestens einen Kleinbuchstaben verwenden",
"wordUppercase": "Bitte mindestens einen Großbuchstaben verwenden",
"word": "Bitte mindestens einen Buchstaben verwenden",
"wordOneNumber": "Bitte mindestens eine Ziffern verwenden",
"wordOneSpecialChar": "Bitte mindestens ein Sonderzeichen verwenden",
"errorList": "Fehler:",
@@ -8,6 +8,7 @@
"wordRepetitions": "Too many repetitions",
"wordSequences": "Your password contains sequences",
"wordLowercase": "Use at least one lowercase character",
"word": "Use at least one character",
"wordUppercase": "Use at least one uppercase character",
"wordOneNumber": "Use at least one number",
"wordOneSpecialChar": "Use at least one special character",
@@ -144,13 +144,13 @@ try {
validation.wordTwoCharacterClasses = function(options, word, score) {
var specialCharRE = new RegExp(
'(.' + options.rules.specialCharClass + ')'
'(.' + options.rules.specialCharClass + ')', 'u'
);
if (
word.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/) ||
(word.match(/([a-zA-Z])/) && word.match(/([0-9])/)) ||
(word.match(specialCharRE) && word.match(/[a-zA-Z0-9_]/))
word.match(/(\p{Ll}.*\p{Lu})|(\p{Lu}.*\p{Ll})/u) ||
(word.match(/(\p{Letter})/u) && word.match(/([0-9])/)) ||
(word.match(specialCharRE) && word.match(/[\p{Letter}0-9_]/u))
) {
return score;
}
@@ -202,11 +202,15 @@ try {
};
validation.wordLowercase = function(options, word, score) {
return word.match(/[a-z]/) && score;
return word.match(/\p{Ll}/u) && score;
};
validation.wordUppercase = function(options, word, score) {
return word.match(/[A-Z]/) && score;
return word.match(/\p{Lu}/u) && score;
};
validation.word = function(options, word, score) {
return word.match(/\p{Letter}/u) && score;
};
validation.wordOneNumber = function(options, word, score) {
@@ -218,7 +222,7 @@ try {
};
validation.wordOneSpecialChar = function(options, word, score) {
var specialCharRE = new RegExp(options.rules.specialCharClass);
var specialCharRE = new RegExp(options.rules.specialCharClass, 'u');
return word.match(specialCharRE) && score;
};
@@ -228,27 +232,27 @@ try {
options.rules.specialCharClass +
'.*' +
options.rules.specialCharClass +
')'
')', 'u'
);
return word.match(twoSpecialCharRE) && score;
};
validation.wordUpperLowerCombo = function(options, word, score) {
return word.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/) && score;
return word.match(/(\p{Ll}.*\p{Lu})|(\p{Lu}.*\p{Ll})/u) && score;
};
validation.wordLetterNumberCombo = function(options, word, score) {
return word.match(/([a-zA-Z])/) && word.match(/([0-9])/) && score;
return word.match(/([\p{Letter}])/u) && word.match(/([0-9])/) && score;
};
validation.wordLetterNumberCharCombo = function(options, word, score) {
var letterNumberCharComboRE = new RegExp(
'([a-zA-Z0-9].*' +
'([\p{Letter}0-9].*' +
options.rules.specialCharClass +
')|(' +
options.rules.specialCharClass +
'.*[a-zA-Z0-9])'
'.*[\p{Letter}0-9])', 'u'
);
return word.match(letterNumberCharComboRE) && score;
@@ -341,6 +345,7 @@ defaultOptions.rules.scores = {
wordTwoCharacterClasses: 2,
wordRepetitions: -25,
wordLowercase: 1,
word: 1,
wordUppercase: 3,
wordOneNumber: 3,
wordThreeNumbers: 5,
@@ -361,6 +366,7 @@ defaultOptions.rules.activated = {
wordTwoCharacterClasses: true,
wordRepetitions: true,
wordLowercase: true,
word: true,
wordUppercase: true,
wordOneNumber: true,
wordThreeNumbers: true,
@@ -372,7 +378,7 @@ defaultOptions.rules.activated = {
wordIsACommonPassword: true
};
defaultOptions.rules.raisePower = 1.4;
defaultOptions.rules.specialCharClass = "(?=.*?[^A-Za-z\s0-9])"; //'[!,@,#,$,%,^,&,*,?,_,~]';
defaultOptions.rules.specialCharClass = "(?=.*?[^\\p{Letter}\\s0-9])"; //'[!,@,#,$,%,^,&,*,?,_,~]';
// List taken from https://github.com/danielmiessler/SecLists (MIT License)
defaultOptions.rules.commonPasswords = [
'123456',
File diff suppressed because one or more lines are too long
+22 -7
View File
@@ -20,7 +20,7 @@ function getPath() {
return jsFileLocation.substr(0, jsFileLocation.search("/static/js/libs/jquery.min.js")); // the js folder path
}
function postButton(event, action){
function postButton(event, action, location=""){
event.preventDefault();
var newForm = jQuery('<form>', {
"action": action,
@@ -30,7 +30,14 @@ function postButton(event, action){
'name': 'csrf_token',
'value': $("input[name=\'csrf_token\']").val(),
'type': 'hidden'
})).appendTo('body');
})).appendTo('body')
if(location !== "") {
newForm.append(jQuery('<input>', {
'name': 'location',
'value': location,
'type': 'hidden'
})).appendTo('body');
}
newForm.submit();
}
@@ -212,17 +219,20 @@ $("#delete_confirm").click(function(event) {
$( ".navbar" ).after( '<div class="row-fluid text-center" >' +
'<div id="flash_'+item.type+'" class="alert alert-'+item.type+'">'+item.message+'</div>' +
'</div>');
}
});
$("#books-table").bootstrapTable("refresh");
}
});
} else {
postButton(event, getPath() + "/delete/" + deleteId);
var loc = sessionStorage.getItem("back");
if (!loc) {
loc = $(this).data("back");
}
sessionStorage.removeItem("back");
postButton(event, getPath() + "/delete/" + deleteId, location=loc);
}
}
});
//triggered when modal is about to be shown
@@ -541,6 +551,7 @@ $(function() {
$.get(e.relatedTarget.href).done(function(content) {
$modalBody.html(content);
preFilters.remove(useCache);
$("#back").remove();
});
})
.on("hidden.bs.modal", function() {
@@ -621,8 +632,12 @@ $(function() {
"btnfullsync",
"GeneralDeleteModal",
$(this).data('value'),
function(value){
path = getPath() + "/ajax/fullsync"
function(userid) {
if (userid) {
path = getPath() + "/ajax/fullsync/" + userid
} else {
path = getPath() + "/ajax/fullsync"
}
$.ajax({
method:"post",
url: path,
+3 -5
View File
@@ -24,7 +24,7 @@ $(document).ready(function() {
},
}, function () {
if ($('#password').data("verify")) {
if ($('#password').data("verify") === "True") {
// Initialized and ready to go
var options = {};
options.common = {
@@ -38,22 +38,20 @@ $(document).ready(function() {
showVerdicts: false,
}
options.rules= {
specialCharClass: "(?=.*?[^A-Za-z\\s0-9])",
specialCharClass: "(?=.*?[^\\p{Letter}\\s0-9])",
activated: {
wordNotEmail: false,
wordMinLength: $('#password').data("min"),
// wordMaxLength: false,
// wordInvalidChar: true,
wordSimilarToUsername: false,
wordSequences: false,
wordTwoCharacterClasses: false,
wordRepetitions: false,
wordLowercase: $('#password').data("lower") === "True" ? true : false,
wordUppercase: $('#password').data("upper") === "True" ? true : false,
word: $('#password').data("word") === "True" ? true : false,
wordOneNumber: $('#password').data("number") === "True" ? true : false,
wordThreeNumbers: false,
wordOneSpecialChar: $('#password').data("special") === "True" ? true : false,
// wordTwoSpecialChar: true,
wordUpperLowerCombo: false,
wordLetterNumberCombo: false,
wordLetterNumberCharCombo: false