aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorcglatot <[email protected]>2020-10-12 16:10:43 +0100
committerGitHub <[email protected]>2020-10-12 16:10:43 +0100
commit4485f808baa3827842a3c6326edc0cc916793e12 (patch)
treec1cb4ec18ef6262caaf5b15251eb241bf4b9dbcc
parentf4427997bba84348c63bb16abba34ab9fa7f1ef0 (diff)
parent5b5a462f6e8db1219fb12db84384557db519851e (diff)
downloadpasta-4485f808baa3827842a3c6326edc0cc916793e12.tar.gz
pasta-4485f808baa3827842a3c6326edc0cc916793e12.zip
Merge pull request #31 from cglatot/non-english-characters1.6.2
Add support for non English characters
-rw-r--r--css/main.css11
-rw-r--r--js/main.js15
2 files changed, 24 insertions, 2 deletions
diff --git a/css/main.css b/css/main.css
index 9bb7175..007c02a 100644
--- a/css/main.css
+++ b/css/main.css
@@ -240,8 +240,15 @@ label, p {
cursor: default;
}
+#alphabetGroup {
+ border-radius: 0.25rem;
+ overflow: hidden;
+ max-width: 990px;
+}
+
#alphabetGroup button {
margin-left: 0;
+ border-radius: 0;
}
#alphabetGroup .btn-outline-dark {
@@ -397,11 +404,11 @@ table, td, tr, th {
}
@media only screen and (max-width: 1199px) {
- #alphabetGroup.btn-group .btn:not(:last-child):not(.dropdown-toggle) {
+ /*#alphabetGroup.btn-group .btn:not(:last-child):not(.dropdown-toggle) {
border-bottom-left-radius: 0;
}
#alphabetGroup.btn-group .btn:not(:first-child) {
border-top-right-radius: 0;
- }
+ }*/
} \ No newline at end of file
diff --git a/js/main.js b/js/main.js
index 306412f..c0b7d11 100644
--- a/js/main.js
+++ b/js/main.js
@@ -536,6 +536,7 @@ function getAlphabet(uid, row) {
function displayAlphabet(data, row) {
const availableAlphabet = data.MediaContainer.Directory;
+
if (data.MediaContainer.thumb.indexOf('show') > -1) { libraryType = "shows"; }
else { libraryType = "movie"; }
@@ -574,6 +575,20 @@ function displayAlphabet(data, row) {
$(`#btn${availableAlphabet[i].title}`).prop("disabled", false);
}
}
+
+ // Get the non-English characters
+ const nonEngChars = availableAlphabet.filter(entry => !entry.title.match(/[a-z#]/i));
+
+ // Remove all custom buttons after the Z
+ $('#btnZ').nextAll().remove();
+
+ if (nonEngChars.length > 0) {
+ // Add buttons for the non English characters
+ for (let j = 0; j < nonEngChars.length; j++) {
+ $('#alphabetGroup').append(`<button id="btn${nonEngChars[j].title}" type="button" class="btn btn-outline-dark"
+ onclick="getLibraryByLetter(this)">${nonEngChars[j].title}</button>`);
+ }
+ }
}
function getLibraryByLetter(element) {