Viltrax wrote:
Even I'd forgotten about it, and it's in my 'area'.
IE9 works for me, but it's just javascript - shouldn't be too hard to investigate and fix.
These are the only two files involved -
http://www.shatteredkingdoms.org/desc_editorhttp://www.shatteredkingdoms.org/editor.jsIf anyone has some time to check what the error is in the Chrome console (press F12) and resolve it, I'd be happy to apply updates as necessary.
Cheers.
It looks like this code was originally written to only work in IE. The fact that it has ever worked in Firefox or Chrome is pure coincidence. Can't properly test the code below, but I believe it will get the job done.
The error in Chrome was easy to spot. The Agent string for Chrome has no ';' characters, so when the VInfo variable gets assigned "Agent.split(";")" the length to the VInfo array is 1. Javascript being a zero-based indexing language, with Ver tries to get assigned "VInfo[
1].substr(6,3)" you get an error, because VInfo[1] is null.
Firefox doesn't throw an error because there actually is a ';' character in the Agent string, but that's pure coincidence. Furthermore, when the VInfo[1] substring happens, Ver gets the value ".0" which is hilarious because the code thinks Firefox is IE version 0, so the "if" statement below all these assignments has a condition to check the version number and if it is less that 5.5, the code returns out, turning the description editors to nothing.
TL;DR Try replacing this code:
Code:
// Check for IE 5.5+ on Windows
var Agent, VInfo, MSIE, Ver, Win32, Opera;
Agent = navigator.userAgent;
VInfo = Array(); // version info
VInfo = Agent.split(";")
MSIE = Agent.indexOf('MSIE') > 0;
Ver = VInfo[1].substr(6,3);
Win32 = Agent.indexOf('Windows') > 0 && Agent.indexOf('Mac') < 0 && Agent.indexOf('Windows CE') < 0;
Opera = Agent.indexOf('Opera') > -1;
if (!MSIE || Opera || Ver < 5.5 || !Win32) { return; }
with this code:
Code:
// Check for IE 5.5+ on Windows, Chrome, or Firefox
var Agent, VInfo, MSIE, Ver, Win32, Opera, ChromeOrFirefox;
Agent = navigator.userAgent;
ChromeOrFirefox = Agent.indexOf('Chrome') > 0 || Agent.indexOf('Firefox') > 0;
if(!ChromeOrFirefox)
{
VInfo = Array(); // version info
VInfo = Agent.split(";")
MSIE = Agent.indexOf('MSIE') > 0;
Ver = VInfo[1].substr(6,3);
Win32 = Agent.indexOf('Windows') > 0 && Agent.indexOf('Mac') < 0 && Agent.indexOf('Windows CE') < 0;
Opera = Agent.indexOf('Opera') > -1;
if (!MSIE || Opera || Ver < 5.5 || !Win32) { return; }
}