This commit is contained in:
Alexey Skobkin 2016-05-10 00:42:16 +03:00
parent 8f75c8d315
commit 0ba765e181
1 changed files with 16 additions and 16 deletions

View File

@ -68,7 +68,7 @@ function PointPlus(ppVersion) {
$go_to_unread_block = $('<div>').attr({
id: 'pp-go-to-unread',
}).click(function() {
var $unread_comment = $('#comments .post.unread').first();
var $unread_comment = $('#comments div.post.unread').first();
if ($unread_comment.length > 0) {
$('html body').animate({ scrollTop: $unread_comment.offset().top }, 500);
@ -137,7 +137,7 @@ function PointPlus(ppVersion) {
// If scripts are executed
if (response) {
// Processing links
$('.post .post-content a[href*="\\:\\/\\/soundcloud\\.com\\/"]').each(function(index) {
$('div.post .post-content a[href*="\\:\\/\\/soundcloud\\.com\\/"]').each(function(index) {
console.log($(this));
// @todo: вынести в отдельный шаблон
@ -225,7 +225,7 @@ function PointPlus(ppVersion) {
if (options.is('option_fancybox_smart_hints')) {
fancybox_set_smart_hints();
} else {
$('.post .postimg').attr('data-fancybox-title', ' ');
$('div.post .postimg').attr('data-fancybox-title', ' ');
}
// Videos
@ -259,22 +259,22 @@ function PointPlus(ppVersion) {
if (options.is('option_nsfw_hide_posts')) {
if ($('#comments').length == 0) {
console.log('Hide NSFW posts in feed, %i hidden', $('.post').length);
$('.post').addClass('hide-nsfw-posts');
console.log('Hide NSFW posts in feed, %i hidden', $('div.post').length);
$('div.post').addClass('hide-nsfw-posts');
}
}
// Blurred posts
if (options.is('option_nsfw_blur_posts_entire')) {
console.log('Bluring NSFW posts');
$('.post').addClass('blur-nsfw-entire');
$('div.post').addClass('blur-nsfw-entire');
} else if (options.is('option_nsfw_blur_posts_images')) {
console.log('Bluring images in NSFW posts');
$('.post').addClass('blur-nsfw-images');
$('div.post').addClass('blur-nsfw-images');
}
// Blurred comments
if ($('.post').hasClass('post-tag-nsfw') || $('.post').hasClass('post-tag-сиськи')) {
if ($('div.post').hasClass('post-tag-nsfw') || $('div.post').hasClass('post-tag-сиськи')) {
if (options.is('option_nsfw_blur_comments_entire')) {
console.log('Bluring comments');
$('#comments').addClass('blur-nsfw-entire');
@ -472,7 +472,7 @@ function PointPlus(ppVersion) {
console.info('Inserting comment');
// Search for parent comment
$parentComment = (wsMessage.to_comment_id) ? ($('.post[data-comment-id="' + wsMessage.to_comment_id + '"]')) : [];
$parentComment = (wsMessage.to_comment_id) ? ($('div.post[data-comment-id="' + wsMessage.to_comment_id + '"]')) : [];
console.log('Parent comment: %O', $parentComment || null);
// If list mode or not addressed to other comment
@ -731,7 +731,7 @@ function create_comment_elements(commentData, onCommentCreated) {
* @param {?object} $span jQuery object of unread count <span>
*/
function update_right_panel_unread_count($span) {
var unread_count = $('#comments .post.unread').length;
var unread_count = $('#comments div.post.unread').length;
if (typeof $span === 'undefined') {
$span = $('#pp-unread-count');
@ -745,7 +745,7 @@ function update_right_panel_unread_count($span) {
// Помечаем непрочитанные посты более видимо чем каким-то баджем
// Эта часть написана @RainbowSpike
function mark_unread_post() {
var divs = $(".content-wrap > .post").css({'padding-left':'2px'}); // массив постов
var divs = $(".content-wrap > div.post").css({'padding-left':'2px'}); // массив постов
for (var i = 0; i < divs.length; i++) { // обыск постов
var spans = $(divs[i]).find(".unread"); // поиск метки непрочитанных комментов
if (spans.length > 0) { // если в посте есть непрочитанные комменты...
@ -870,7 +870,7 @@ function set_posts_count_label() {
var posts = {};
var ids;
$('.content-wrap > .post').each(function(n, post) {
$('.content-wrap > div.post').each(function(n, post) {
var $post = $(post);
var postId = $post.data('id');
@ -879,7 +879,7 @@ function set_posts_count_label() {
ids = Object.keys(posts);
$('.content-wrap > .post .post-id a .cn').addClass('changed_background');
$('.content-wrap > div.post .post-id a .cn').addClass('changed_background');
$.ajax('https://api.kanaria.ru/point/get_post_info.php?list=' + encodeURIComponent(ids.join(',')), {
dataType: 'json',
@ -926,7 +926,7 @@ function parse_pleercom_links(current_options) {
// Проставляем теги у постов
// @hint В данный момент эта фича используются для NSFW, потом выборку по тегам можно будет использовать много где
function create_tag_system() {
$('.content-wrap > .post').each(function() {
$('.content-wrap > div.post').each(function() {
var tags = $(this).find('div.tags a.tag');
for (var i = 0; i < tags.length; i++) {
var tag_name = $(tags[i]).html().toLowerCase();
@ -960,7 +960,7 @@ function set_space_key_skip_handler() {
function space_key_event() {
var scroll_current = Math.floor($('body').scrollTop());
var posts = $('.content-wrap > .post');
var posts = $('.content-wrap > div.post');
for (var i = 0; i < posts.length; i++) {
var this_top_px = Math.floor(posts.eq(i).offset().top);
if (this_top_px > scroll_current) {
@ -1112,7 +1112,7 @@ function parse_coub_links(current_options) {
// Правим хинт в FancyBox
function fancybox_set_smart_hints(){
$('.post').each(function() {
$('div.post').each(function() {
var all_post_images = $(this).find('.postimg');
if (all_post_images.length == 0) {
return;