Nokita Kaze 2014-12-26 13:14:21 +03:00
parent b41b20e5eb
commit c46b58fb0e
6 changed files with 65 additions and 9 deletions

View File

@ -156,7 +156,10 @@
"option_other_scroll_space_key":{
"message": "Scrolling posts with `space` key"
},
"option_other_comments_nesting_level":{
"message": "Comments Nesting level indicator"
},
"options_feedback_text": {
"message": "<p>If you find an error do not hesitate to <a href=\"https:\/\/bitbucket.org\/skobkin\/chrome_point_plus\/issues?status=new&status=open\" target=\"_blank\">send me a bug report<\/a>.<\/p><p>Also you can make a donation in the following ways:<\/p><p><iframe frameborder=\"0\" allowtransparency=\"true\" scrolling=\"no\" src=\"https:\/\/money.yandex.ru\/embed\/small.xml?account=41001539215836&quickpay=small&yamoney-payment-type=on&button-text=04&button-size=s&button-color=black&targets=Point%2B&default-sum=150&successURL=https%3A%2F%2Fbitbucket.org%2Fskobkin%2Fchrome_point_plus\" width=\"158\" height=\"31\"><\/p><p><\/iframe><\/p><p><iframe frameborder=\"0\" allowtransparency=\"true\" scrolling=\"no\" src=\"https:\/\/money.yandex.ru\/embed\/small.xml?account=41001539215836&quickpay=small&any-card-payment-type=on&button-text=04&button-size=s&button-color=black&targets=Point%2B&default-sum=150&successURL=https%3A%2F%2Fbitbucket.org%2Fskobkin%2Fchrome_point_plus\" width=\"158\" height=\"31\"><\/iframe><\/p><p><form action=\"https:\/\/www.paypal.com\/cgi-bin\/webscr\" method=\"post\" target=\"_top\"><input type=\"hidden\" name=\"cmd\" value=\"_s-xclick\"><input type=\"hidden\" name=\"hosted_button_id\" value=\"RCW5V6UFXYTRE\"><input type=\"image\" src=\"https:\/\/www.paypalobjects.com\/ru_RU\/RU\/i\/btn\/btn_donateCC_LG.gif\" border=\"0\" name=\"submit\" alt=\"PayPal — более безопасный и легкий способ оплаты через Интернет!\"><img alt=\"\" border=\"0\" src=\"https:\/\/www.paypalobjects.com\/en_US\/i\/scr\/pixel.gif\" width=\"1\" height=\"1\"><\/form><\/p>"
}

View File

@ -156,6 +156,9 @@
"option_other_scroll_space_key":{
"message": "Скроллинг постов пробелом"
},
"option_other_comments_nesting_level":{
"message": "Индикатор уровня вложенности коммнентариев"
},
"options_feedback_text": {

View File

@ -286,3 +286,14 @@ div#markItUpText-input {
.current-user-hint .change_hint_block .button_cancel{
}
/* Шваброточки */
#comments .post .nesting{
height: 24px;
float: left;
}
#comments .post:hover .nesting {
background-repeat: repeat-x;
background-image: url('chrome-extension://__MSG_@@extension_id__/images/habra-point.png');
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 593 B

View File

@ -158,7 +158,7 @@ $(document).ready(function() {
if (options.option_nsfw_hide_posts.value == true) {
if ($('#comments').length == 0) {
console.log('Hide NSFW posts in feed');
console.log('Hide NSFW posts in feed, '+$('.post').length+' hidden');
$('.post').addClass('hide-nsfw-posts');
}
}
@ -500,6 +500,11 @@ $(document).ready(function() {
// Система комментариев у пользователей
hints_init_user_system();
// Nesting level indicator
if (options.option_other_comments_nesting_level.value == true) {
draw_nesting_level_indicator();
}
$('#point-plus-debug').fadeOut(1000);
});
});
@ -615,7 +620,7 @@ function create_image(domain, id, additional) {
// Помечаем непрочитанные посты более видимо чем каким-то баджем
// Эта часть написана @RainbowSpike
function mark_unread_post() {
var divs = $(".post").css({'padding-left':'2px'}); // массив постов
var divs = $(".content-wrap > .post").css({'padding-left':'2px'}); // массив постов
for (var i = 0; i < divs.length; i++) { // обыск постов
var spans = $(divs[i]).find(".unread"); // поиск метки непрочитанных комментов
if (spans.length > 0) { // если в посте есть непрочитанные комменты...
@ -739,12 +744,12 @@ function audio_extension_to_mime(extension) {
}
}
// Плашки у постов
// Плашки с кол-вом уникальных пользователей и рекомендаций у постов
function set_posts_count_label() {
var ids = [];
$('.post .post-id a .cn').addClass('changed_background');
$('.content-wrap > .post .post-id a .cn').addClass('changed_background');
$('div.post').each(function(num, obj) {
$('.content-wrap > .post').each(function(num, obj) {
var t = $(obj).attr('data-comment-id');
if (typeof(t) !== 'undefined') {
return;
@ -758,7 +763,7 @@ function set_posts_count_label() {
'success': function(a) {
var answer = JSON.parse(a);
$('div.post').each(function(num, obj) {
$('.content-wrap > .post').each(function(num, obj) {
var id = $(obj).attr('data-id');
var postid = $(obj).find('.post-id a')[0];
var t = $(obj).attr('data-comment-id');
@ -864,7 +869,7 @@ function create_pleercom_ajax(id, current_options) {
// Проставляем теги у постов
// @hint В данный момент эта фича используются для NSFW, потом выборку по тегам можно будет использовать много где
function create_tag_system() {
$('.post').each(function() {
$('.content-wrap > .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();
@ -900,7 +905,7 @@ function space_key_event() {
var scroll_step_size = 0;
var scroll_real = Math.max(scroll_current - scroll_step_size, 0);
var posts = $('.post');
var posts = $('.content-wrap > .post');
for (var i = 0; i < posts.length; i++) {
var this_top_px = $(posts[i]).offset().top;
if (this_top_px > scroll_real) {
@ -1156,3 +1161,33 @@ function hints_save_new_hint(username, new_hint) {
chrome.storage.sync.set({'point_user_hints': items.point_user_hints});
});
}
/**
* Nesting level indicator
* Шваброшвабровские точки
*/
function draw_nesting_level_indicator() {
$('.comments').css({'margin-left': '0px'});
draw_nesting_level_indicator_level($('#comments > .comments'), 1);
}
function draw_nesting_level_indicator_level(obj, level) {
obj.find('> .post').each(function () {
var nesting = document.createElement('div');
$(nesting).addClass('nesting').css({
'width': (10 * level) + 'px'
});
this.insertBefore(nesting, $(this).find('.info')[0]);
$(this).find('> .post-content').css({
'padding-left': (10 * level) + 'px'
});
});
obj.each(function () {
var comments = $(this).find('> .comments');
if (comments.length > 0) {
draw_nesting_level_indicator_level(comments, level + 1);
}
});
}

View File

@ -170,6 +170,10 @@
<div class="option-node">
<input type="checkbox" class="option-boolean" id="option-other-scroll-space-key"><label for="option-other-scroll-space-key" data-i18n="option_other_scroll_space_key"></label>
</div>
<div class="option-node">
<input type="checkbox" class="option-boolean" id="option-other-comments-nesting-level"><label for="option-other-comments-nesting-level" data-i18n="option_other_comments_nesting_level"></label>
</div>
</div>
<div class="tab-content" id="websocket">