[2.0.10] Select Expand BBcodes MOD

The cleanup is complete. This forum is now read only.

Rating:

Excellent!
20
91%
Very Good
1
5%
Good
0
No votes
Fair
0
No votes
Poor
1
5%
 
Total votes: 22

User avatar
onigumo
Registered User
Posts: 1755
Joined: Fri Oct 31, 2003 2:32 am
Contact:

Post by onigumo » Thu Dec 02, 2004 6:21 am

Oh -- actually, markus_petrux, I was referring to the width. You said the height, and that referrs to the vertical. I'm referring to the horrizontal.

Once in a while (it seems to always be the last quote, if there are several in one post, or, if there's only one, that one might be stretched from end to end on the post). Refreshing doesn't work. The fix doesn't work. I've tried it, and if I'm correct, the fix wasn't the right one to solve my particular problem. Here's a link to a thread that shows several of these stretched quotes: http://pb.exocrew.com/haruko/viewtopic. ... highlight=
I write articles on community building
@ The Infinity Program.

markus_petrux
Former Team Member
Posts: 1887
Joined: Wed Apr 23, 2003 7:11 am
Location: Girona, Catalunya (Spain)
Contact:

Post by markus_petrux » Thu Dec 02, 2004 6:41 am

Well, it's almost the same problem. There's no reliable way to compute the width or the height of the blocks.

The select/expand block uses a table. The width of this table is set to 90%, relative to its parent layer (which is another table, the post text). So, browsers should follow this rule, but they don't (sometimes).

In the example you've posted, Firefox renders some blocks 100%, but IE6 renders all them correctly at 90% (surprisingly). I've seen other examples where IE6 renders the block at 100% or more.

So, this depends on each browser's implementation. I don't know what can be done to fix different browser behaviours.
EasyMOD Standards | MOD Template Actions | MODs in Development Rules
Useful information for MOD Authors | MOD Queue Stats | Search MODs
Write SQL/DDL portable to all SQL servers supported by phpBB!
Get EasyMOD 0.3.0! | Suport al phpBB en Català!
8)

User avatar
onigumo
Registered User
Posts: 1755
Joined: Fri Oct 31, 2003 2:32 am
Contact:

Post by onigumo » Thu Dec 02, 2004 7:02 am

I see. Thank you for the information.
I write articles on community building
@ The Infinity Program.

User avatar
drumstix42
Registered User
Posts: 1100
Joined: Tue Sep 24, 2002 11:01 pm
Location: NJ
Contact:

Post by drumstix42 » Thu Dec 02, 2004 9:43 am

I've found a very good solution to my prefences.

My default settings aren't far from default

Code: Select all

	this.id = id;
	this.size = this.min = 45;	// --- 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.
What I've done below is left everything normal, but I've modified how it expands it in size.

If after expanding, it smaller than your screen height (minus 300 to make up for borders and browser bars), then it will expand it auto.
If it it greater than this, it will expand it to your screen height minus 300, and add a scroll bar.

I did this, because when people post huge chunks of code, I find it easier to just be scrolling in the code block, rather than the whole page.

Open: templates/select_expand_bbcodes.js

Find:

Code: Select all

		o.style.height = 'auto';
		o.style.overflow = 'visible';
Replace With:

Code: Select all

		if( (o.scrollHeight + this.extra) > screen.height-300 )
		{
		   o.style.height = screen.height-300;
		}
		else
		{
		  o.style.height = 'auto';
		}
		o.style.overflow = 'auto';
Enjoy ;)
Need a phpBB update or mod installed? PM me for any questions and pricing!
HostMonster.com (Unlimited Space, Unlimited Transfer, Unlimited Domains, $6.95/month )

markus_petrux
Former Team Member
Posts: 1887
Joined: Wed Apr 23, 2003 7:11 am
Location: Girona, Catalunya (Spain)
Contact:

Post by markus_petrux » Thu Dec 02, 2004 10:04 am

I love to see these kind of tweaks. :)

That probably means the code has been found, at least, "readable".
EasyMOD Standards | MOD Template Actions | MODs in Development Rules
Useful information for MOD Authors | MOD Queue Stats | Search MODs
Write SQL/DDL portable to all SQL servers supported by phpBB!
Get EasyMOD 0.3.0! | Suport al phpBB en Català!
8)

User avatar
drumstix42
Registered User
Posts: 1100
Joined: Tue Sep 24, 2002 11:01 pm
Location: NJ
Contact:

Post by drumstix42 » Thu Dec 02, 2004 10:10 am

Just figured out my other thing. Finally this mod is exactly how I want it :

This modifaction will change the way it displays the text originally (if it doesn't need to be expanded). If the text height is smaller than your default height it will downsize it (make it size automatically).

Very simple, just hard for me to explain I guess.

Basically I like my default block size to be around 90, but if a code or quote is posted with only 1 line, you have an extra space. Here's the fix:

Open: templates/select_expand_bbcodes.js

Find:

Code: Select all

		if( o.scrollHeight <= this.min ) { x.innerHTML = ''; return; }
Replace With:

Code: Select all

		if( o.scrollHeight <= this.min ) { x.innerHTML = ''; o.style.height = 'auto'; return; }
Enjoy ;)

My 2 modifcations are displayed in this post:

http://www.advancedmod.com/forums/viewtopic.php?t=2549
Need a phpBB update or mod installed? PM me for any questions and pricing!
HostMonster.com (Unlimited Space, Unlimited Transfer, Unlimited Domains, $6.95/month )

Lechacal
Registered User
Posts: 14
Joined: Thu Jul 29, 2004 7:50 am

Post by Lechacal » Tue Mar 15, 2005 3:53 pm

hey ;)

excuse me, but I try to install this Mod "select_expand_bbcodes_mod_v1_0_2" !!

I have not error, but I have just a block with just "Citation: " !!??

I have not "expend" etc...

am french and my anglish he's very very bad sorry !! :oops:

I have to try with different browser :

- IE
- SlimBrowser
- Firefox

and it's a same thing !! :cry:

your Mod he's very interresting for me, I have a big Topic, but I don't understand why he doesn't work, and what I can to do !!??

Can you help me please ??

thk ;)

BoZaR
Registered User
Posts: 5
Joined: Sat Jan 22, 2005 11:35 am

Post by BoZaR » Tue Mar 22, 2005 12:47 pm

Hello, your mod don't work correctly with me :( , can u help me?
here a screenshot:
[img=http://img173.exs.cx/img173/2152/bug8fy.jpg]

Wulf_9
Registered User
Posts: 130
Joined: Sun Mar 20, 2005 8:13 pm
Location: Norwich, UK

Markus, You Rock!

Post by Wulf_9 » Tue Mar 22, 2005 4:14 pm

This is just what I was looking for. I run a board about train simulation software, which means I sometimes want to post large chunks of script, so I needed a way of controlling the appearance of long [ code ] blocks - this thing is soooo kewl in how it expands and contracts, what's more the select thing is just right for ppl to copy the code and save it.
Then along comes drumstix42 with his scrollbar tweak and man, we're cooking on gas :D

Thanks hugely to all involved! :)

You can view my board here - it's loaded with subtle tweaks and mods, mostly for security, some for 'ergonomics', but boo's style is the business for eye-candy - SLW Roundhouse - based off a hand-modded 2.0.11 with AttachMOD 2.3.11 (and too many other things to list here but the intention was to have really tight security and high performance). Before anyone screams "upgrade now" I plan to do that in the next day or so - after the current round of modding and playing with .htaccess stuff I need a breather 8)

Sorry, no guest posting allowed ;)
`
"It's not the things you do right that matter, it's the things you don't do wrong"

Wulf_9
Registered User
Posts: 130
Joined: Sun Mar 20, 2005 8:13 pm
Location: Norwich, UK

...and more

Post by Wulf_9 » Tue Mar 22, 2005 6:44 pm

Hi Markus and drumstix,

Here's another tweak, which gives better control over the sub-window objects. In cases where there's a very small block of code or quote, the scrollbar arrows were still present when collapsed, even if the block is within the limits of the dimensional settings at the top of the file. I also reduced the size of the correction factor from 300 to 200 (running Firefox 1.01 at 1024x768 just for reference).

Here's how it goes...

Instead of this:-

Code: Select all

      if( (o.scrollHeight + this.extra) > screen.height-300 )
      {
         o.style.height = screen.height-300;
      }
      else
      {
        o.style.height = 'auto';
      }
      o.style.overflow = 'auto';
do this:-

Code: Select all

      if( (o.scrollHeight + this.extra) > screen.height - 200 )
      {
        o.style.height = screen.height - 200; // add scrollbar if visible area bigger than window
        o.style.overflow = 'auto';
      }
      else
      {
        o.style.height = 'auto';
        o.style.overflow = 'visible';
      }
which integrates the old and new behaviours nicely ;)

p.s. can you show how to use window-size percentages instead of fixed resize factors? That way I don't have to worry about who's running what resolution when they view the content.

Thanks for all the great work 8)
`
"It's not the things you do right that matter, it's the things you don't do wrong"

Lechacal
Registered User
Posts: 14
Joined: Thu Jul 29, 2004 7:50 am

Post by Lechacal » Sat Mar 26, 2005 3:32 am

hey ;)

Thank you very much for this MOD. :wink:

It functions very well. :P

I was mistaken with the file to put at the root of the template. :?

Having several template, I had put it in each, but it is before it must be put!! :)

expend/Template

and not

Template/expend

it's no realy the same thing !! ;)

thank you still and good weekend :P :wink: bye

User avatar
Cronz
Registered User
Posts: 69
Joined: Mon Jan 10, 2005 2:06 am

Post by Cronz » Tue Mar 29, 2005 5:28 am

theres a prob with the width 4 FF
Last edited by Cronz on Fri Apr 01, 2005 6:59 am, edited 1 time in total.

User avatar
drumstix42
Registered User
Posts: 1100
Joined: Tue Sep 24, 2002 11:01 pm
Location: NJ
Contact:

Post by drumstix42 » Tue Mar 29, 2005 7:30 am

no it's just the code of the forums. refresh the page.
Need a phpBB update or mod installed? PM me for any questions and pricing!
HostMonster.com (Unlimited Space, Unlimited Transfer, Unlimited Domains, $6.95/month )

TKF2
Registered User
Posts: 37
Joined: Thu Feb 17, 2005 2:42 pm
Location: Leerbroek (near Gorinchem), The Netherlands
Contact:

Post by TKF2 » Tue Mar 29, 2005 9:09 am


User avatar
Cronz
Registered User
Posts: 69
Joined: Mon Jan 10, 2005 2:06 am

Post by Cronz » Tue Mar 29, 2005 2:31 pm

but liek with IE theres a width bar placed not 4 FF which makes it strech out
Last edited by Cronz on Fri Apr 01, 2005 6:59 am, edited 1 time in total.

Post Reply

Return to “[2.0.x] MOD Database Cleanup”