From 85cc117b33c70841e4a8dfba7f81b6d154cae109 Mon Sep 17 00:00:00 2001 From: Michael Save Date: Thu, 15 Mar 2012 17:05:33 +1100 Subject: [PATCH] post-hover.js --- js/post-hover.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 js/post-hover.js diff --git a/js/post-hover.js b/js/post-hover.js new file mode 100644 index 00000000..4771c42d --- /dev/null +++ b/js/post-hover.js @@ -0,0 +1,30 @@ +/* + * post-hover.js + * https://github.com/savetheinternet/Tinyboard-Tools/blob/master/js/post-hover.js + * + * Released under the MIT license + * Copyright (c) 2012 Michael Save + * + * Usage: + * $config['additional_javascript'][] = 'js/jquery.min.js'; + * $config['additional_javascript'][] = 'js/post-hover.js'; + * + */ + +$(document).ready(function(){ + $('p.body a:not([rel="nofollow"])').each(function() { + var id; + + if(id = $(this).text().match(/^>>(\d+)$/)) { + id = id[1]; + } + + var post = $('div.post#reply_' + id); + $(this).hover(function() { + post.attr('style', 'border-style: none dashed dashed none; background: ' + post.css('border-color')); + }, function() { + post.attr('style', ''); + }); + }); +}); +