|
|
|
|
@ -1,62 +1,13 @@ |
|
|
|
|
$(document).ready(function(){ |
|
|
|
|
|
|
|
|
|
$(".alist li").click(function(){ |
|
|
|
|
console.log("lolololol"); |
|
|
|
|
var ctnt = $(this).find('.content-wrapper')[0] |
|
|
|
|
$(ctnt).toggleClass("open")
|
|
|
|
|
}); |
|
|
|
|
var $limit = 45; |
|
|
|
|
// $("#articles ul li a span").each(function(){
|
|
|
|
|
// if ($(this).text().length > $limit){
|
|
|
|
|
// var cut = $(this).text().substring(0, $limit) + " ...";
|
|
|
|
|
// $(this).html(cut);
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
// wimg = $(".img_container").width();
|
|
|
|
|
// console.log(wimg);
|
|
|
|
|
// $(".img_container").css("height",wimg);
|
|
|
|
|
//
|
|
|
|
|
// $(window).resize(function(){
|
|
|
|
|
// wimg = $(".img_container").width();
|
|
|
|
|
// console.log(wimg);
|
|
|
|
|
// $(".img_container").css("height",wimg);
|
|
|
|
|
// })
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
$('#gal .img_container img').click(function(){ |
|
|
|
|
// $(" #gal .img_container").removeClass("fullImg");
|
|
|
|
|
$(this).parent().toggleClass("fullImg"); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
function sortArticles(columnClass) { |
|
|
|
|
const $list = $('.alist'); |
|
|
|
|
const $listItems = $list.children('li'); |
|
|
|
|
|
|
|
|
|
// Sort the list items based on the text of the specified column
|
|
|
|
|
$listItems.sort(function(a, b) { |
|
|
|
|
const aText = $(a).find('.' + columnClass).text().trim().toLowerCase(); |
|
|
|
|
const bText = $(b).find('.' + columnClass).text().trim().toLowerCase(); |
|
|
|
|
|
|
|
|
|
return aText.localeCompare(bText); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
// Detach and reappend sorted items to maintain DOM structure
|
|
|
|
|
$list.empty().append($listItems); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Add click event to legend spans
|
|
|
|
|
//$('.legend li span').on('click', function() {
|
|
|
|
|
//// Get the class corresponding to the clicked span
|
|
|
|
|
//const columnClass = $(this).text().toLowerCase().replace(/\s+/g, '');
|
|
|
|
|
|
|
|
|
|
//// If the column exists in the article items, sort by that column
|
|
|
|
|
//if ($('.alist li').first().find('.' + columnClass).length > 0) {
|
|
|
|
|
//sortArticles(columnClass);
|
|
|
|
|
//}
|
|
|
|
|
//$(".alist li").click(function(){
|
|
|
|
|
//console.log("lolololol");
|
|
|
|
|
//var ctnt = $(this).find('.content-wrapper')
|
|
|
|
|
//$(ctnt).toggleClass("open")
|
|
|
|
|
//});
|
|
|
|
|
|
|
|
|
|
const sortState = {}; |
|
|
|
|
|
|
|
|
|
const sortState = {}; |
|
|
|
|
|
|
|
|
|
// Function to sort articles
|
|
|
|
|
function sortArticles(columnClass) { |
|
|
|
|
@ -113,6 +64,27 @@ $(document).ready(function(){ |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$(".alist").on('click', 'li ', function(e) { |
|
|
|
|
// Prevent this event from interfering with sorting or default link behavior
|
|
|
|
|
e.preventDefault(); |
|
|
|
|
|
|
|
|
|
console.log("lolololol"); |
|
|
|
|
var ctnt = $(this).find('.content-wrapper'); |
|
|
|
|
if (ctnt.length === 0) { |
|
|
|
|
ctnt = $(this).closest('li').find('.content-wrapper'); |
|
|
|
|
} |
|
|
|
|
$(ctnt).toggleClass("open"); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
//$(".alist").on('click', 'li', function(e) {
|
|
|
|
|
//// Prevent this event from interfering with sorting
|
|
|
|
|
//if ($(e.target).closest('.legend').length === 0) {
|
|
|
|
|
//console.log("lolololol");
|
|
|
|
|
//var ctnt = $(this).find('.content-wrapper');
|
|
|
|
|
//$(ctnt).toggleClass("open");
|
|
|
|
|
//}
|
|
|
|
|
//});
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|