Shattered Kingdoms

Where Roleplay and Tactics Collide
VOTE NOW!
It is currently Fri Nov 22, 2024 9:17 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 28 posts ]  Go to page Previous  1, 2, 3

Wherein does the brokenness lie?
It's broken. 12%  12%  [ 5 ]
You're broken. 5%  5%  [ 2 ]
Wait, there's a description editor? 40%  40%  [ 17 ]
We don't want you and your silly colorful descriptions. 7%  7%  [ 3 ]
Who cares? 7%  7%  [ 3 ]
42 30%  30%  [ 13 ]
Total votes : 43
Author Message
 Post subject: Re: the description editor
PostPosted: Mon Feb 25, 2013 6:19 am 
Offline
Mortal

Joined: Fri Dec 26, 2008 1:22 pm
Posts: 1648
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_editor
http://www.shatteredkingdoms.org/editor.js

If 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; }
  }


Last edited by Rodwen on Mon Mar 18, 2013 11:05 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: the description editor
PostPosted: Sun Mar 03, 2013 4:45 am 
Offline
Mortal

Joined: Fri Dec 26, 2008 1:22 pm
Posts: 1648
bump?


Top
 Profile  
Reply with quote  
 Post subject: Re: the description editor
PostPosted: Sun Mar 17, 2013 3:08 pm 
Offline
Mortal

Joined: Fri Dec 26, 2008 1:22 pm
Posts: 1648
Do I need to put this fix in place myself?


Top
 Profile  
Reply with quote  
 Post subject: Re: the description editor
PostPosted: Mon Mar 18, 2013 11:02 am 
Offline
Mortal

Joined: Thu Oct 28, 2004 7:18 pm
Posts: 452
I think they already forgot it again. :(


Top
 Profile  
Reply with quote  
 Post subject: Re: the description editor
PostPosted: Mon Mar 18, 2013 11:03 am 
Offline
Mortal

Joined: Fri Dec 26, 2008 1:22 pm
Posts: 1648
Threnody wrote:
I think they already forgot it again. :(

I tried to help.


Top
 Profile  
Reply with quote  
 Post subject: Re: the description editor
PostPosted: Mon Mar 18, 2013 11:06 am 
Offline
Mortal

Joined: Thu Oct 28, 2004 7:18 pm
Posts: 452
Rodwen wrote:
Threnody wrote:
I think they already forgot it again. :(

I tried to help.


You did! By which I am impressed (it's far outside my knowledge) and for which I am grateful! Cookies for you :D

But it seems to evade immortal consciousness like the location of my car keys evade mine =/


Top
 Profile  
Reply with quote  
 Post subject: Re: the description editor
PostPosted: Fri Mar 22, 2013 8:20 am 
Offline
Mortal

Joined: Fri Dec 26, 2008 1:22 pm
Posts: 1648
I hope Viltrax is alright.


Top
 Profile  
Reply with quote  
 Post subject: Re: the description editor
PostPosted: Thu May 02, 2013 9:57 am 
Offline
Mortal

Joined: Fri Dec 26, 2008 1:22 pm
Posts: 1648
Pretty sure he's not alright, at this point.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 28 posts ]  Go to page Previous  1, 2, 3

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 80 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group