Addon for Select Expand BBCodes MOD v1.0.2
 
 
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
Onizuka
Starter
Starter


Joined: 27 Oct 2004
Posts: 2

PostPosted: Wed Oct 27, 2004 9:19 pm    Post subject: Addon for Select Expand BBCodes MOD v1.0.2 Reply with quote

when you quote someone who only have post one line... you have an empty space between the words and the border!
To fix it:
Code:
# OPEN:
template/select_expand_bbcode.js
# FIND:
   var s = ( SXBB_IsOverflowAble() ? 'style="overflow:auto;height:'+this.min+'px;"' : '' );
# REPLACE WITH:
   var s = ( SXBB_IsOverflowAble() ? 'style="overflow:auto;height:auto;"' : '' );
# FIND:
      if( cmd == 'onload' )
      {
# AFTER ADD:
         if( o.scrollHeight > this.min ) { o.style.height = this.min+"px"; }
# FIND:
         x.innerHTML = this.genCmd('resize', this.T['expand']);
# AFTER ADD:
         var s = ""+self.document.location;
         var occur = s.match("viewtopic.*#(.*)");
         if (occur.length==2){
            location.replace("#"+occur[1]);
         }
 
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Thu Oct 28, 2004 5:49 pm    Post subject: Re: Addon for Select Expand BBCodes MOD v1.0.2 Reply with quote

Onizuka: Sorry for the delay in replying. I wanted to find the time to test your fix before posting. Wink

Onizuka wrote:
when you quote someone who only have post one line... you have an empty space between the words and the border!

Thanks for the suggestion. However, I believe it might generate a somehow annoying effect.

If you remove the height when building the initial CSS styles of the block:
Code:
var s = ( SXBB_IsOverflowAble() ? 'style="overflow:auto;height:auto;"' : '' );

...it will be rendered as expanded. Solved (contracted) by the changes to the onload event (in your fix). The problem I see here is it might be annoying depending on the time required to load the page. I mean there's a noticeable delay between the initial display of the blocks (expanded) and the onload event (contracted).

I don't quite understand why do you reload the page with this code? Confused

Code:
         var s = ""+self.document.location;
         var occur = s.match("viewtopic.*#(.*)");
         if (occur.length==2){
            location.replace("#"+occur[1]);
         }

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


Joined: 27 Oct 2004
Posts: 2

PostPosted: Fri Oct 29, 2004 1:51 pm    Post subject: Re: Addon for Select Expand BBCodes MOD v1.0.2 Reply with quote

the quote is render as extended on page load, after load, this mod collase the quote if it's required!

Code:
      if( cmd == 'onload' )
      {
         if( o.scrollHeight > this.min ) { o.style.height = this.min+"px"; }


when you read a post using an URL directly pointing on this post (for example: http://forums.phpmix.org/viewtopic.php?p=1299#1299 ) and the previous post contains a long quote, when this quote is collapsed, you are not more on the message that you want to see (due to delay)! the redirection is for stage this problem

i know for the delay, it can be annoying on slowest computer or server but, i wanted to have quote of min 100 pix, imagine my user quote one line... i'll have a very big space. i don't say it's a good solution, it's just a solution i found for my forum and maybe someone'll use it or will have another idee so i post it here Wink

here is an exemple:
http://www.gyonline.net/forum/viewtopic.php?p=7300#7300

(sorry for my english)
 
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Fri Oct 29, 2004 2:50 pm    Post subject: Re: Addon for Select Expand BBCodes MOD v1.0.2 Reply with quote

ok, thanks for the clarification. Nice add-on.

There's another possible solution: just set the minimum height of the layer by "touching" these lines:

Code:
#
# ---[ OPEN ]----------
#
templates/select_expand_bbcodes.js
#
# ---[ FIND ]----------
#
   this.size = this.min = 40;   // --- Adjust MINIMUM_BLOCK_HEIGHT here :-)
   this.extra = 5;            // --- This is added to height when expanded
   this.margin = 20;         // --- Hide [expand] command if just a few pixels height when expanded.
#
# ---[ REPLACE WITH ]----------
#
   this.size = this.min = 20;   // --- Adjust MINIMUM_BLOCK_HEIGHT here :-)
   this.extra = 5;            // --- This is added to height when expanded
   this.margin = 20;         // --- Hide [expand] command if just a few pixels height when expanded.
#
# ---[ SAVE ]----------
#

...or just play with the values (min, extra and margin). Maybe you can find better defaults than myself. TBH, I didn't spent much time on that. Wink

Still not a perfect solution, though.

 
 
_________________
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