[ready]Makes bIcon better

This commit is contained in:
CitadelStationBot
2017-08-13 17:41:12 -05:00
parent 6d72705ff5
commit bd35823012
68 changed files with 644 additions and 180 deletions
@@ -28,10 +28,14 @@ img {
margin: 0;
padding: 0;
line-height: 1;
-ms-interpolation-mode: nearest-neighbor;
image-rendering: pixelated;
}
img.icon {
width: 16px;
height: 16px;
height: 1em;
min-height: 16px;
width: auto;
vertical-align: bottom;
}
a {color: #0000ff;}
@@ -357,7 +361,6 @@ h1.alert, h2.alert {color: #000000;}
.clown {color: #FF69Bf; font-size: 24px; font-family: "Comic Sans MS", cursive, sans-serif; font-weight: bold;}
.his_grace {color: #15D512; font-family: "Courier New", cursive, sans-serif; font-style: italic;}
BIG IMG.icon {width: 32px; height: 32px;}
.memo {color: #638500; text-align: center;}
.memoedit {text-align: center; font-size: 16px;}
@@ -29,6 +29,8 @@ var opts = {
'messageLimit': 2053, //A limit...for the messages...
'scrollSnapTolerance': 10, //If within x pixels of bottom
'clickTolerance': 10, //Keep focus if outside x pixels of mousedown position on mouseup
'imageRetryDelay': 50, //how long between attempts to reload images (in ms)
'imageRetryLimit': 50, //how many attempts should we make?
'popups': 0, //Amount of popups opened ever
'wasd': false, //Is the user in wasd mode?
'chatMode': 'default', //The mode the chat is in
@@ -146,6 +148,23 @@ function highlightTerms(el) {
el.innerHTML = newText;
}
}
function iconError(E) {
var that = this;
setTimeout(function() {
var attempts = $(that).data('reload_attempts');
if (typeof attempts === 'undefined' || !attempts) {
attempts = 1;
}
if (attempts > opts.imageRetryLimit)
return;
var src = that.src;
that.src = null;
that.src = src+'#'+attempts;
$(that).data('reload_attempts', ++attempts);
}, opts.imageRetryDelay);
}
//Send a message to the client
function output(message, flag) {
if (typeof message === 'undefined') {
@@ -271,7 +290,7 @@ function output(message, flag) {
entry.innerHTML = message.trim();
$messages[0].appendChild(entry);
$(entry).find("img.icon").error(iconError);
//Actually do the snap
if (!filteredOut && atBottom) {
$('body,html').scrollTop($messages.outerHeight());
@@ -861,7 +880,11 @@ $(function() {
$messages.empty();
opts.messageCount = 0;
});
$('img.icon').error(iconError);
/*****************************************
*