Also some gui changes:
function init(){
GM_addStyle('#hook_button {background-color: #00AD71; color: #FFFFFF; cursor: pointer; display: inline-block; font-size: 0.8125em; padding: 10px; vertical-align: bottom;}');
console.log('loaded review search style')
try
{
var footer = document.getElementsByTagName('footer'),
$btn = jQuery('<div id="hook_button" title="Search">Search Similar</div>').on('click', doWKSearch);
jQuery(footer[0]).prepend($btn);
window.addEventListener("keypress", hook_hotkey);
}
catch(error) {console.log(error);}
}
You’ll have to change this at the top as well
// @grant GM_addStyle
1 Like
mickos
May 19, 2020, 12:30am
23
Thanks for this gth99 and ToastedRice ! I ended up with a small variation myself actually… building a really quick and dirty alternative on ToastedRice’s example above. I prefer having the button below my input box instead - eg. I added the pencil to search.
(In addition to the updated function copytext(), replace init with below)
function init(){
console.log('loading review search button and key hook')
try
{
$('#additional-content ul').css('text-align','center').append(
'<li id="hook_button"><span title="Search"><i class="icon-pencil"></i></span></li></ul>'
);
$("#hook_button").click(doWKSearch);
window.addEventListener("keypress", hook_hotkey);
}
catch(error) {console.log(error);}
}
1 Like
gth99
May 22, 2020, 5:18pm
24
Cool, I’ll have to check out these mods if I ever come back from vacation mode! Glad you’re finding it useful and making improvements