mirror of
https://bitbucket.org/skobkin/chrome_point_plus.git
synced 2024-11-23 18:56:04 +00:00
Comments highlight fix. Now fading out in 20 seconds.
This commit is contained in:
parent
0d5e0449a3
commit
2a1493fc2a
|
@ -10,6 +10,23 @@ div#markItUpText-input {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Point+ */
|
/* 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 */
|
/* Options page */
|
||||||
.pp-options {
|
.pp-options {
|
||||||
width: 450px;
|
width: 450px;
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
<div class="pp-highlight"></div>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<a href="#"><img class="avatar" src="#author-avatar" alt=""/></a>
|
<a href="#"><img class="avatar" src="#author-avatar" alt=""/></a>
|
||||||
<div class="created">
|
<div class="created">
|
||||||
|
|
|
@ -228,7 +228,7 @@ $(document).ready(function() {
|
||||||
// If list mode or not addressed to other comment
|
// If list mode or not addressed to other comment
|
||||||
if ((treeSwitch == '?tree=0') || (wsMessage.to_comment_id == null)) {
|
if ((treeSwitch == '?tree=0') || (wsMessage.to_comment_id == null)) {
|
||||||
// List mode
|
// 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 {
|
} else {
|
||||||
// Tree mode
|
// Tree mode
|
||||||
// Search parent comment
|
// Search parent comment
|
||||||
|
@ -240,21 +240,27 @@ $(document).ready(function() {
|
||||||
// If child comment already exist
|
// If child comment already exist
|
||||||
if ($parentCommentChildren.length > 0) {
|
if ($parentCommentChildren.length > 0) {
|
||||||
console.log('Child comments found. Appending...');
|
console.log('Child comments found. Appending...');
|
||||||
$parentCommentChildren.append($commentTemplate.hide().fadeIn(2000).css('background-color', '#FFFFBB'));
|
$parentCommentChildren.append($commentTemplate.hide().fadeIn(2000));
|
||||||
} else {
|
} else {
|
||||||
console.log('No child comments found. Creating...');
|
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 {
|
} else {
|
||||||
console.log('Parent comment not found');
|
console.log('Parent comment not found');
|
||||||
// FIXME: Double code
|
// 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
|
// Adding anchor
|
||||||
$commentTemplate.before($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();
|
console.groupEnd();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@
|
||||||
<input type="checkbox" id="option-ws-comments"><label for="option-ws-comments">Process comments</label>
|
<input type="checkbox" id="option-ws-comments"><label for="option-ws-comments">Process comments</label>
|
||||||
|
|
||||||
<div class="option">
|
<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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue