《百张照片中的苏联》
The USSR in 100 Photographs

原始链接: https://trinixy.ru/7039-sssr_v_fotografijakh_100_foto.html

所提供的文本并非说明性文章,而是一段用于管理网站(很可能是基于 DLE 引擎构建的 Trinixy.ru)前端功能的 **JavaScript 代码**集合。 该脚本实现的关键技术功能包括: * **图片管理:** 自动检测页面上的图片并为其添加社交媒体/书签按钮,包括异步检查图片是否已被收藏。 * **UI/UX 优化:** 滚动触发的顶部栏,可动态显示导航、评分以及登录/注册链接。 * **评论系统逻辑:** 评论线程的高级管理,包括用于折叠/展开嵌套回复的功能、隐藏回复的计数器,以及通过直接链接访问时自动滚动到特定评论。 * **导航:** 根据预定义变量处理“上一篇”和“下一篇”文章的链接。 总之,这段代码纯粹是功能性的,旨在通过简化图片交互、评论导航和界面响应速度来提升用户体验。

对不起。
相关文章

原文

Комментарии (117) 

Показать сначала комментарии:

'); } }); } var i = 1; $("#dle-content .newsarea div.picture").each(function() { var img = $(this).find("img").attr("src"); var domain = window.location.hostname; var imgUrl = img.indexOf("https://"); if ( imgUrl == -1 ) img = 'https://' + domain + img; $(this).append('

'; $(this).append(social); i++; }); $(function () { $('.social').mouseover(function(){ $(".highslide").replaceWith(function(index, oldHTML){ return $("

").html(oldHTML); }); }); $(document).share(); var postid=7039; $("#dle-content .newsarea div.picture").hover( function() { $(this).find(".sorting").show(); /*favorited state check*/ var that = $(this); if ($(this).find(".social .fav").hasClass("hide")) { var img=$(this).find(".social .fav").attr("data-share-image"); $.ajax({ url: "/engine/ajax/getpicinfo.php", dataType: 'json', data: { news_id: postid, img: img }, success: function(resp) { if (resp.res=="1") { that.find(".social .fav").addClass("favorited"); that.find(".social .fav").attr("title", "Удалить изображение из закладок"); that.find(".social .fav").attr("state", "minus"); } that.find(".social .fav").removeClass("hide"); } }); } /*favorited state check*/ }, function() { $(this).find(".sorting").hide(); } ); }); $(function () { var bar = $('#topbar'); var top = bar.css('top'); var img_post = $('.newsarea img'); var beginning_comm = $('#dle-comments-list'); if (img_post.length 0) { bar.stop().css({ 'position': 'absolute' }); } if ($(this).scrollTop() > 200) { bar.stop().css({ 'position': 'fixed', 'overflow': 'visible'}).animate({ 'top': '0px', 'height': '40px', 'opacity': '1' }, 100); } else { bar.stop().css({ 'position': 'fixed', 'overflow': 'hidden' }).animate({ 'top': top, 'height': '0', 'opacity': '0' }, 100); } if (beginning_comm.length) { if ($(this).scrollTop() > beginning_comm.offset().top) { bar.stop().css({ 'position': 'fixed', 'overflow': 'hidden' }).animate({ 'top': top, 'height': '0', 'opacity': '0' }, 100); bar.css('overflow', 'hidden'); } } }); // $('#uibg').parent().css('visibility', 'hidden'); }); window.addEventListener('scroll', function () { if ($(this).scrollTop() > 200) { $('.rating').clone().appendTo('.topbar_rating'); $('.log-reg').clone(true).appendTo('.topbar_log_reg'); $("a[class^='fav-id-']").clone().appendTo('.topbar_fav_post'); this.removeEventListener('scroll', arguments.callee); } }); // var prev_post = 'https://trinixy.ru/7040-udivitelnye_krossovki_7_foto.html'; var next_post = 'https://trinixy.ru/7034-zvezdnye_svadby_49_foto.html'; if (prev_post=="javascript:void(0);") $('.prev_post').hide(); if (next_post=="javascript:void(0);") $('.next_post').hide(); $('.prev_post a').attr({ 'href' : prev_post }); $('.next_post a').attr({ 'href' : next_post }); /* Comments collapse begin */ function collapsecomments() { $("#dle-comments-list > ol.comments-tree-list > li.comments-tree-item").each(function(){ if ($(this).find("li.comments-tree-item").length > 1) { var comm_count=$(this).find("li.comments-tree-item").length - 1; if ($(this).find("ol.comments-tree-list .readall").length == 0) $(this).find("ol.comments-tree-list li[rel=1]:first").after("

Читать все ответы на комментарий ("+comm_count+")

"); $(this).find("li.comments-tree-item:not(:first)").hide(); } //$(this).find("li.comments-tree-item").closest("ol.comments-tree-list").not('.comments-tree-list:first').css({ "background": "#eee", "padding": "10px" }); $(this).find("li.comments-tree-item").find("div[id^=comment-id-]").addClass('comment-id-tree-item'); //$(this).find("ol.comments-tree-list:last").css({ "padding-bottom": "20px" }); $(this).find("li.comments-tree-item").find("ol.comments-tree-list").css("padding-left", "0"); $(this).find("li.comments-tree-item").find("a[onmouseover^=dle_copy_quote]").remove(); }); } collapsecomments(); // Для прокрутки по ссылке до комментария var anchor = document.location.href.split('#'); if (typeof anchor[1] != 'undefined') { var anchor_item = anchor[1].split('-'); if (typeof anchor_item[2] != 'undefined') { var parent_tree_comment = $('#comments-tree-item-' + anchor_item[2]).closest("li.comm-free-parent"); parent_tree_comment.find("li.comments-tree-item").show(); parent_tree_comment.find("div.readall").hide(); //$("html, body").animate({ scrollTop: $($('#comments-tree-item-' + anchor_item[2])).offset().top }, 500); $('#comment-id-' + anchor_item[2]).hide(); $('#comment-id-' + anchor_item[2]).show(2000); } } // End $(".readall").click(function() { $(this).closest("ol.comments-tree-list").find("li.comments-tree-item").show(); $(this).hide(); }); function togglecomments() { if ($("#togglecomments").attr("data") == "collapse") { $("#togglecomments").attr("data", "collapsed"); $("#togglecomments").find("img").attr("src", "/templates/trinixy20/images/dlet-sign-04-1.gif"); $('.readall').hide(); $("ol.comments-tree-list li.comments-tree-item").show(); $("#togglecomments").find("img").attr("title", "Свернуть все вложенные комментарии"); } else { $("#togglecomments").attr("data", "collapse"); $("#togglecomments").find("img").attr("src", "/templates/trinixy20/images/dlet-sign-03-1.gif"); collapsecomments(); $('.readall').show(); $("#togglecomments").find("img").attr("title", "Показать все вложенные комментарии"); } } /* Comments collapse end */

Информация

联系我们 contact @ memedata.com