Select / Expand BBCode Mod: Little Problem
 
 
Post new topic   Reply to topic   printer-friendly view    phpMiX.org Forum Index -> phpBB MODs -> Select Expand BBCodes
View previous topic :: View next topic  
Author Message
Playa
Starter
Starter


Joined: 09 Jan 2006
Posts: 2

PostPosted: Mon Jan 09, 2006 9:26 pm    Post subject: Select / Expand BBCode Mod: Little Problem Reply with quote

Cool mod, indeed!

I works perfectly on my board using firefox browser.
if i use internet explorer, the link "collapse / expand" is not displayed.
i use also the bbcode box mod by reddev, and there is a file included called "fade.js", wich causes a fading bbcode effect.
if i remove this fade.js from overall header, the "collapse / expand" link is also displayed in internet explorer.

??!?!?


on firefox both java scripts work fine together, both on ie alwasy ONE of them works.

here is the this fade.js: http://connect.co.funpic.de/phpBB2/bbcode_box/fade.js

the select_expand_bbcodes.js is here


would be happy if you could find the problem markus!
Thank you!
 
Back to top
View user's profile Send private message
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Mon Jan 09, 2006 10:34 pm    Post subject: Re: Select / Expand BBCode Mod: Little Problem Reply with quote

Quote:
if i use internet explorer, the link "collapse / expand" is not displayed.

Does it show the link "select"? ...or it does disappear too?

Does the problem happen if the fade BBCode is being used or does it happen always (only by the fact that fade.js is loaded)?

Do you see any javascript error? If so, the browser may not attempt to run other javascript code (the select/expand code is loaded in the document body, in the post where it is used), so it may be affected by previous javascript errors, however...

...I may try to figure out, but that's hard too difficult to tell (looking at javascript written by others).

 
 
_________________
http://www.phpmix.org
 
Back to top
View user's profile Send private message
Playa
Starter
Starter


Joined: 09 Jan 2006
Posts: 2

PostPosted: Tue Jan 10, 2006 10:39 am    Post subject: Re: Select / Expand BBCode Mod: Little Problem Reply with quote

markus wrote:
Quote:
if i use internet explorer, the link "collapse / expand" is not displayed.

Does it show the link "select"? ...or it does disappear too?

Does the problem happen if the fade BBCode is being used or does it happen always (only by the fact that fade.js is loaded)?

Do you see any javascript error? If so, the browser may not attempt to run other javascript code (the select/expand code is loaded in the document body, in the post where it is used), so it may be affected by previous javascript errors, however...

...I may try to figure out, but that's hard too difficult to tell (looking at javascript written by others).


Hi markus!

The Link "select" is always shown!!

The problem happen only by the fact that the fade.js is loaded.

and no, there are no java script errors.


It would be great if you find the problem, because i love both javascripts, the fading thing and your geat mod too!!
 
Back to top
View user's profile Send private message
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Tue Jan 10, 2006 11:08 pm    Post subject: Re: Select / Expand BBCode Mod: Little Problem Reply with quote

Ok, for some reason, when fade.js is loaded, the loop in this function of the select/expand code is broken in IE (maybe a bug in the browser):

Code:
function SXBB_evalSize(cmd)
{
   for( var id in SXBB ) SXBB[id].resize(cmd);   // line 204
}

The browser reports "Object does not support this property or method" in line 204. The error doesn't tell you which file, but it refers to select_expand_bbcodes.js

Investigating the code in fade.js, I've found that the cause is the following code:

Code:
Array.prototype.inArray=function(str){//on modifie l'objet Array
for(i=0; i< this.length; i++)if(this[i].toString()==str)return i;
return -1;
}

The author of the code decided to extend the object Array, which is not a very good technique, as it may affect other javascripts present in the page (as it happens here), rather than coding a normal function that gets the array via parameter.

I would suggest to contact the author of the fade.js code, which would be in benefit of all the users of his BBCode, and ask him to provide a fix. Point him to this topic, if you wish. Note his code also uses a lot of other global variables that could be overridden by other javascripts in the same page. He would have to fix that as well, to avoid more such conflicts in the future.

If you look at my javascript code, you'll notice that I tend to use as little global variables as possible, and always try to use unique names for them (I choose SXBB in this case and all global functions are prefixed with this name), for this very reason.

Good luck! Wink

 
 
_________________
http://www.phpmix.org
 
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    phpMiX.org Forum Index -> phpBB MODs -> Select Expand BBCodes All times are GMT + 1 Hour
 
Page 1 of 1


 
Jump to:  
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
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum