Better highlighting.

This commit is contained in:
Nicolas Stepien 2011-05-19 21:15:06 +02:00
parent 432702dd41
commit 373f9c2939
2 changed files with 20 additions and 14 deletions

View File

@ -1707,6 +1707,7 @@
$.bind(link, 'mouseover', quotePreview.mouseover);
$.bind(link, 'mousemove', ui.hover);
$.bind(link, 'mouseout', ui.hoverend);
$.bind(link, 'mouseout', quotePreview.mouseout);
}
if ($.config('Quote Inline')) {
$.bind(link, 'click', quoteInline.toggle);
@ -1825,10 +1826,14 @@
quote = _ref[_i];
$.bind(quote, 'mouseover', quotePreview.mouseover);
$.bind(quote, 'mousemove', ui.hover);
_results.push($.bind(quote, 'mouseout', ui.hoverend));
$.bind(quote, 'mouseout', ui.hoverend);
_results.push($.bind(quote, 'mouseout', quotePreview.mouseout));
}
return _results;
},
mouseout: function() {
return $.removeClass(d.getElementById(this.hash.slice(1)), 'qphl');
},
mouseover: function(e) {
var el, id, qp, req, threadID;
if (!(id = this.hash.slice(1))) {
@ -1837,10 +1842,7 @@
qp = $('#qp');
if (el = d.getElementById(id)) {
qp.innerHTML = el.innerHTML;
if (el.className === 'reply') {
el.className = 'replyhl';
this.setAttribute('onmouseout', "document.getElementById(" + id + ").className='reply'; this.removeAttribute('onmouseout');");
}
$.addClass(el, 'qphl');
} else {
qp.innerHTML = "Loading " + id + "...";
threadID = this.pathname.split('/').pop();
@ -2460,13 +2462,11 @@
}\
\
#navlinks {\
font-size: 16px;\
position: fixed;\
top: 25px;\
right: 5px;\
}\
#navlinks {\
font-size: 16px;\
}\
\
#options {\
position: fixed;\
@ -2566,6 +2566,9 @@
#qp input {\
display: none;\
}\
.qphl {\
outline: 2px solid rgba(216, 94, 49, .7);\
}\
'
};
main.init();

View File

@ -1374,6 +1374,7 @@ quoteBacklink =
$.bind link, 'mouseover', quotePreview.mouseover
$.bind link, 'mousemove', ui.hover
$.bind link, 'mouseout', ui.hoverend
$.bind link, 'mouseout', quotePreview.mouseout
if $.config 'Quote Inline'
$.bind link, 'click', quoteInline.toggle
$.before $('td > br, blockquote', el), link
@ -1452,14 +1453,15 @@ quotePreview =
$.bind quote, 'mouseover', quotePreview.mouseover
$.bind quote, 'mousemove', ui.hover
$.bind quote, 'mouseout', ui.hoverend
$.bind quote, 'mouseout', quotePreview.mouseout
mouseout: ->
$.removeClass d.getElementById(@hash[1..]), 'qphl'
mouseover: (e) ->
return unless id = @hash[1..]
qp = $ '#qp'
if el = d.getElementById id
qp.innerHTML = el.innerHTML
if el.className is 'reply'
el.className = 'replyhl'
@setAttribute 'onmouseout', "document.getElementById(#{id}).className='reply'; this.removeAttribute('onmouseout');"
$.addClass el, 'qphl'
else
qp.innerHTML = "Loading #{id}..."
threadID = @pathname.split('/').pop()
@ -1923,13 +1925,11 @@ main =
}
#navlinks {
font-size: 16px;
position: fixed;
top: 25px;
right: 5px;
}
#navlinks {
font-size: 16px;
}
#options {
position: fixed;
@ -2029,6 +2029,9 @@ main =
#qp input {
display: none;
}
.qphl {
outline: 2px solid rgba(216, 94, 49, .7);
}
'
main.init()