The more universal smiley code successfully tested in
Chromium Version 34.0.1847.116.
Complete Stylish code:
Chrome Large Smileys,
Chrome Small Smileys,
Firefox Large Smileys,
Firefox Small Smileys. Perhaps you didn't apply the patch correctly? If you can confirm the Chrome version also works for you that would be great.
Slight tweak to additional colors, added dark grey & fixed topic post icons:
Chrome &
Firefox.
- Original, lots of pink
- colors.png (6.33 KiB) Viewed 26971 times
- additional colors
- colors.01.png (14.62 KiB) Viewed 26971 times
For your CSS apparently Chrome doesn't like
ms. Works with seconds. Also updated my original post.
Dybal wrote:The only tweak I did with yours is to have the info roll back up quicker.
Around line 1071:
Code: Select all
transition: margin-top ease-in 0.5s;
-webkit-transition: margin-top ease-in 0.5s;
Finally, I ran a diff between the different versions of the imagus mod and came up with a bit ugly hack:
Code: Select all
// ==UserScript==
// @name Imagus Background Toggle
// @version 0.0.4
// @description Toggles the Imagus hover background color
// @match http://*/*
// ==/UserScript==
// a function that loads jQuery and calls a callback function when jQuery has finished loading
function addJQuery(callback) {
var script = document.createElement('script');
script.setAttribute('src', '//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js');
script.addEventListener('load', function() {
var script = document.createElement('script');
script.textContent = 'window.jQ=jQuery.noConflict(true);(' + callback.toString() + ')();';
document.body.appendChild(script);
}, false);
document.body.appendChild(script);
}
function main(){
var nextColor = (function() {
var colorArray = ['black','white','red','#00ff00','transparent'];
var count = -1;
return function() {
return colorArray[++count % colorArray.length];
}
}());
function toggleImagusBorder() {
var imagusDiv = jQ('div[style*="z-index: 2147483647"]');
if (imagusDiv.css('display') !== 'none') {
imagusDiv.css('background', nextColor());
}
}
function toggleGutter() {
var imagusDiv = jQ('div[style*="z-index: 2147483647"]');
if (imagusDiv.css('display') !== 'none') {
var img = jQ('div[style*="z-index: 2147483647"] img');
if (img.css('background-image') == 'none') {
img.css('background-image', 'url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iODAwcHgiIGhlaWdodD0iMzEwcHgiPjxnIG9wYWNpdHk9IjAuNyI+PHBhdGggZmlsbD0iI0ZGMDAwMCIgZD0iTTc5MCwxMHYyOTBIMTBWMTBINzkwIE04MDAsMGgtMTBIMTBIMHYxMHYyOTB2MTBoMTBoNzgwaDEwdi0xMFYxMFYwTDgwMCwweiIvPjwvZz48L3N2Zz4=)');
} else { img.css('background-image', 'none');}
}
}
function doc_keyUpToggleImagusBorder(e) {
if (e.ctrlKey && e.altKey && e.keyCode == 81) {
toggleImagusBorder();
}
if (e.ctrlKey && e.altKey && e.keyCode == 87) {
toggleGutter();
}
}
// register the handler
document.addEventListener('keyup', doc_keyUpToggleImagusBorder, false);
}
// load jQuery and execute the main function
addJQuery(main);
When you run a diff you can see the
toggleGutter() function was removed during the update. Simple enough to stick it back in. Inside
toggleGutter() I wrapped the older code with the fix from
toggleImagusBorder(). That I'm sure can be done more elegantly, but it works.