Comments highlight fix. Now fading out in 20 seconds.

This commit is contained in:
Alexey Skobkin 2014-04-04 05:35:09 +04:00
parent 0d5e0449a3
commit 2a1493fc2a
4 changed files with 29 additions and 5 deletions

View File

@ -10,6 +10,23 @@ div#markItUpText-input {
}
/* Point+ */
/* Post and comments highlights */
.pp-highlight {
z-index: 1;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: #FFFFBB;
}
.post .info, .post .post-content {
z-index: 2;
position: relative;
}
/* Options page */
.pp-options {
width: 450px;

View File

@ -1,3 +1,4 @@
<div class="pp-highlight"></div>
<div class="info">
<a href="#"><img class="avatar" src="#author-avatar" alt=""/></a>
<div class="created">

View File

@ -228,7 +228,7 @@ $(document).ready(function() {
// If list mode or not addressed to other comment
if ((treeSwitch == '?tree=0') || (wsMessage.to_comment_id == null)) {
// List mode
$('.content-wrap #comments #post-reply').before($commentTemplate.hide().fadeIn(2000).css('background-color', '#FFFFBB'));
$('.content-wrap #comments #post-reply').before($commentTemplate.hide().fadeIn(2000));
} else {
// Tree mode
// Search parent comment
@ -240,21 +240,27 @@ $(document).ready(function() {
// If child comment already exist
if ($parentCommentChildren.length > 0) {
console.log('Child comments found. Appending...');
$parentCommentChildren.append($commentTemplate.hide().fadeIn(2000).css('background-color', '#FFFFBB'));
$parentCommentChildren.append($commentTemplate.hide().fadeIn(2000));
} else {
console.log('No child comments found. Creating...');
$parentComment.after($('<div>').addClass('comments').append($commentTemplate.hide().fadeIn(2000).css('background-color', '#FFFFBB')));
$parentComment.after($('<div>').addClass('comments').append($commentTemplate.hide().fadeIn(2000)));
}
} else {
console.log('Parent comment not found');
// FIXME: Double code
$('.content-wrap #comments #post-reply').before($commentTemplate.hide().fadeIn(2000).css('background-color', '#FFFFBB'));
$('.content-wrap #comments #post-reply').before($commentTemplate.hide().fadeIn(2000));
}
}
// Adding anchor
$commentTemplate.before($anchor);
// Fading out highlight if needed
if (options.option_ws_comments_color_fadeout == true) {
console.log('Fading out the highlight');
$commentTemplate.children('.pp-highlight').fadeOut(20000);
}
console.groupEnd();
});

View File

@ -69,7 +69,7 @@
<input type="checkbox" id="option-ws-comments"><label for="option-ws-comments">Process comments</label>
<div class="option">
<input type="checkbox" id="option-ws-comments-color-fadeout"><label for="option-ws-comments-color-fadeout">Fade out highlight in 10 sec</label>
<input type="checkbox" id="option-ws-comments-color-fadeout"><label for="option-ws-comments-color-fadeout">Fade out highlight in 20 sec</label>
</div>
</div>