Page 1 of 8

[2.0.10] Select Expand BBcodes MOD

Posted: Fri Oct 01, 2004 4:12 am
by Extensions Robot
MOD Name: Select Expand BBcodes MOD
Author: markus_petrux
MOD Description: This MOD is a DHTML add-on for the Code and Quote BBCodes. It adds a couple of commands next to the BBCode block title. First one, allows you to Select its contents for easier copy/paste actions. Second one, allows you to Expand or Contract the BBCode block. It has been coded to degrade correctly even if the browser does not support the required features (please, read author notes for further information).

MOD Version: 1.0.2

Download File: select_expand_bbcodes_mod_v1_0_2.zip
mods overview page: View
File Size: 8710 Bytes

Security Score:

Posted: Sun Oct 03, 2004 9:01 pm
by wGEric
MOD Validated/Released

Notes:
This MOD makes it so your quote and code sections are in a small scroll box which you can open to see the full code. This MOD is nice for boards that require users to post large chunks of code or large quotes.

Posted: Sun Oct 03, 2004 11:57 pm
by markus_petrux
More tips and add-on for this MOD:


---- Original Post ------
...omg, already validated! ...I was planning to submit it tomorrow! :lol:

Seriously: Thanks a lot!

I'll update this post later with link to demos, etc.

Posted: Mon Oct 04, 2004 2:36 am
by markus_petrux
This MOD has been inspired by Daz's fi_divexpand control. Some day I was looking for his MOD... unfortunatelly I discovered Daz's site was down (www.forumimages.com). :( ....So, first thing I would like to post here is: BIG THANK YOU, DAZ (among other things) for your great idea when you wrote your fi_divexpand thingy. Best wishes wherever you are. ;)

So, my first motivation was to make Daz's MOD easilly available to the whole phpBB community. However, when I found his MOD (not an easy task atm) I discovered some technical problems related to lack of compatibility with legacy browsers (still on the wild) or malfunction when no javascript support available on the client browser. So, I ended up re-writing the whole thing from scratch. Though, the basic functionallity still remains.

Here you can see a couple of examples:
http://www.phpmix.com/phpBB2/viewtopic.php?p=1164#1164
http://www.phpmix.com/phpBB2/viewtopic.php?p=1165#1165

Please, read the Author Notes section in the MOD script.

IMPORTANT: If you have problems installling this MOD manually, try to carefully follow the MOD script again. It should work. ;)

I would suggest to give EasyMOD a try. It works! It rocks!

Oh, remember to make backups before installing MODs.


The ZIP file also contains a contrib folder with MOD scripts to add the Select/Expand functionallity to the following MODs:
* PHP Syntax Highlighter BBCode.
* Syntax Highlighting BBCode (Beta).

Please, let me know if you need help to implement this somewhere else.

That's all for now.

Enjoy! ;)

Posted: Mon Oct 04, 2004 5:49 am
by msie
Nice MOD!
But...

in IE 6 SP2
Image

in Opera 7.5
Image

in Firefox 1.0 Preview Release
Image

Why?
How to resolve this?

Posted: Mon Oct 04, 2004 8:08 am
by markus_petrux
Congratulations! You have just experienced the ability of this MOD to behave depending on browser's capabilities. :)

Let me explain this a bit. This MOD basically offers two commands (Select and Expand/Contract) but ONLY if they are supported.

The Expand command is based on the overflow:auto CSS attribute. This one IS supported by W3C standard. However, not all browsers support it. So this MOD tries to make some object detection to a) avoid javascript errors b) offer this feature only if supported and c) keep the Expand command hidden if useless, based on the required size of the box (ie. quoting just a few words). It also reacts to the onresize event to hide or show the expand command.

The Select command is based on two different propietary extensions (there's no standard here, ie. it is not part of the DOM specs). It relies on document.selection introduced by MSIE (I'm not sure but I read this is buggy on IEMac, so I disable this on IEMacs) and on document.getSelection introduced by Netscape (also supported by almost all Gecko based browsers). Unfortunatelly (or not, it depends ;) ), even the latest version of Opera seems to follow the DOM standards to the letter, so it does NOT support this feature. That's why you can't see the Select command on Opera 7.54. I don't know why you can't see it on MSIE 6 SP2, though. It might be caused by your browser configuration. If you have javascript enabled, check if you have other restrictions enabled.

You never know, of course, but it should work. I have tested this MOD on the following browsers: Amaya 8.2, Hotjava 3.0, Netscape 4.8, Netscape 7.1, Mozilla 1.7.2, Firefox 0.93 and 1.0PR, Konqueror 3.2, IE6, Opera 5.12, Opera 6.06 and Opera 7.54. So, if supported by the browser, this MOD works with features enabled, if not supported, it tries to degrade nicely.

Posted: Mon Oct 04, 2004 4:33 pm
by reddog
Great :D

I repeat it, I like this MOD, congratulations markus_petrux :wink:

Posted: Tue Oct 05, 2004 1:33 am
by msie
markus_petrux wrote: I don't know why you can't see it on MSIE 6 SP2, though. It might be caused by your browser configuration. If you have javascript enabled, check if you have other restrictions enabled.

oh, i see.
i'll check my ie's settings.
thank you. :)

Posted: Mon Oct 11, 2004 11:39 pm
by deny
I have a little bit different bbcode.tpl.
So i try to make it working but only Select appears.Expand/Colaps does not appear at all.I try with 3 different borwser (Ie6, Opera, Firefox).
Do you have any idea where i made mistake?

Code: Select all

<!-- BEGIN ulist_open --><ul><!-- END ulist_open -->
<!-- BEGIN ulist_close --></ul><!-- END ulist_close -->

<!-- BEGIN olist_open --><ol type="{LIST_TYPE}"><!-- END olist_open -->
<!-- BEGIN olist_close --></ol><!-- END olist_close -->

<!-- BEGIN listitem --><li><!-- END listitem -->
<!-- BEGIN quote_open -->
<div class="quotetitle"><b>{L_QUOTE}:</b>
<script type="text/javascript" src="{U_SXBB_JSLIB}"></script>
<script type="text/javascript">
<!--
	var id = 'SXBB' + (1000 + Math.floor(Math.random() * 5000));
	SXBB[id] = new _SXBB(id);
	SXBB[id].T['select'] = '{L_SELECT}';
	SXBB[id].T['expand'] = '{L_EXPAND}';
	SXBB[id].T['contract'] = '{L_CONTRACT}';
	SXBB[id].writeCmd();
//-->
</script></div><div class="quotecontent">
<script type="text/javascript">
<!--
	SXBB[id].writeDiv();
//-->
</script>
<!-- END quote_open -->

<!-- BEGIN quote_close -->
</div>
<!-- END quote_close -->

<!-- BEGIN quote_username_open -->
<div class="quotetitle"><b>{USERNAME} {L_WROTE}:</b>
<script type="text/javascript" src="{U_SXBB_JSLIB}"></script>
<script type="text/javascript">
<!--
	var id = 'SXBB' + (1000 + Math.floor(Math.random() * 5000));
	SXBB[id] = new _SXBB(id);
	SXBB[id].T['select'] = '{L_SELECT}';
	SXBB[id].T['expand'] = '{L_EXPAND}';
	SXBB[id].T['contract'] = '{L_CONTRACT}';
	SXBB[id].writeCmd();
//-->
</script></div><div class="quotecontent">
<script type="text/javascript">
<!--
	SXBB[id].writeDiv();
//-->
</script><!-- END quote_username_open -->


<!-- BEGIN code_open -->
</span><div class="codetitle"><b>{L_CODE}:</b>
<script type="text/javascript" src="{U_SXBB_JSLIB}"></script>
<script type="text/javascript">
<!--
	var id = 'SXBB' + (1000 + Math.floor(Math.random() * 5000));
	SXBB[id] = new _SXBB(id);
	SXBB[id].T['select'] = '{L_SELECT}';
	SXBB[id].T['expand'] = '{L_EXPAND}';
	SXBB[id].T['contract'] = '{L_CONTRACT}';
	SXBB[id].writeCmd();
//-->
</script></div><div class="codecontent">
<script type="text/javascript">
<!--
	SXBB[id].writeDiv();
//-->
</script>
<!-- END code_open -->

<!-- BEGIN code_close -->
<script type="text/javascript">
<!--
	document.write('</div>');
//-->
</script>
</div><span class="postbody">
<!-- END code_close -->


<!-- BEGIN b_open --><span style="font-weight: bold"><!-- END b_open -->
<!-- BEGIN b_close --></span><!-- END b_close -->

<!-- BEGIN u_open --><span style="text-decoration: underline"><!-- END u_open -->
<!-- BEGIN u_close --></span><!-- END u_close -->

<!-- BEGIN i_open --><span style="font-style: italic"><!-- END i_open -->
<!-- BEGIN i_close --></span><!-- END i_close -->

<!-- BEGIN color_open --><span style="color: {COLOR}"><!-- END color_open -->
<!-- BEGIN color_close --></span><!-- END color_close -->

<!-- BEGIN size_open --><span style="font-size: {SIZE}px; line-height: normal"><!-- END size_open -->
<!-- BEGIN size_close --></span><!-- END size_close -->

<!-- BEGIN img --><img src="{URL}" border="0" /><!-- END img -->

<!-- BEGIN email --><a href="mailto:{EMAIL}">{EMAIL}</A><!-- END email -->

<!-- BEGIN mod_username_open --></span>
<table width="75%" cellspacing="1" cellpadding="3" border="1" align="center">
<tr> 
	  <td><span class="genmed"><b>{L_MOD} {L_BY}  {USERNAME}:</b></span></td>
	</tr>
	<tr>
	  <td class="mod"><!-- END quote_username_open -->
<!-- BEGIN mod_open --></span>
<table width="75%" cellspacing="1" cellpadding="3" border="1" align="center">
<tr> 
	  <td><span class="genmed"><b>{L_MOD}:</b></span></color></td>
	</tr>
	<tr>
	  <td class="mod"><!-- END mod_open -->
<!-- BEGIN mod_close --></td>
	</tr>
</table>
<span class="postbody"><!-- END mod_close -->


<!-- BEGIN intro_open -->
<div class="quotetitle"><b>{L_INTRO}:</b></div><div class="quotecontent"><!-- END intro_open -->
<!-- BEGIN intro_close -->
</div><!-- END intro_close -->

<!-- BEGIN glow_open --><span style="filter: glow(color={GLOWCOLOR}); height:20"><!-- END glow_open -->
<!-- BEGIN glow_close --></span><!-- END glow_close -->

<!-- BEGIN shadow_open --><span style="filter: shadow(color={SHADOWCOLOR}); height:20"><!-- END shadow_open -->
<!-- BEGIN shadow_close --></span><!-- END shadow_close -->

Posted: Tue Oct 12, 2004 1:06 am
by bcs10
i see you are into the DHTML stuff markus... nice mod...

Posted: Tue Oct 12, 2004 4:32 am
by Traiklin
THANK YOU SO MUCH!

I have been looking everywheres for this mod but could not find it for the life of me, the only time I saw it was on PHPNuke or PhpBB Plus installs (they didn't name it)

It works exactly like I was hoping in Firefox (I gave up IE and the others awhile ago) so once again

Edit: It even works like I thought it would in IE6 under SP2


THANK YOU SO MUCH! :D

Posted: Tue Oct 12, 2004 4:55 am
by markus_petrux
deny:
Please, post your original bbcode.tpl. I mean, before applying this MOD. It seems your template uses DIV instead of TABLE for the code/quote BBCodes. I need to see how it was before.

Posted: Tue Oct 12, 2004 10:33 am
by deny
markus_petrux wrote: deny:
Please, post your original bbcode.tpl. I mean, before applying this MOD. It seems your template uses DIV instead of TABLE for the code/quote BBCodes. I need to see how it was before.


Thanks for your response.I've solved problem in mean time by myself.
KIndly thanks again!

Posted: Tue Oct 12, 2004 2:27 pm
by deny
I just thought that i solve problem but there is still bugs.
Example if i would to reply on quote then is my reply inside quote too.
So here is again bbcode.tpl before changing(and above is after changing):

Code: Select all

<!-- BEGIN ulist_open --><ul><!-- END ulist_open -->
<!-- BEGIN ulist_close --></ul><!-- END ulist_close -->

<!-- BEGIN olist_open --><ol type="{LIST_TYPE}"><!-- END olist_open -->
<!-- BEGIN olist_close --></ol><!-- END olist_close -->

<!-- BEGIN listitem --><li><!-- END listitem -->
<!-- BEGIN quote_open -->
<div class="quotetitle"><b>{L_QUOTE}:</b></div><div class="quotecontent">
<!-- END quote_open -->

<!-- BEGIN quote_close -->
</div>
<!-- END quote_close -->

<!-- BEGIN quote_username_open -->
<div class="quotetitle"><b>{USERNAME} {L_WROTE}:</b></div><div class="quotecontent">
<!-- END quote_username_open -->


<!-- BEGIN code_open -->
</span><div class="codetitle"><b>{L_CODE}:</b></div><div class="codecontent">
<!-- END code_open -->

<!-- BEGIN code_close -->
</div><span class="postbody">
<!-- END code_close -->


<!-- BEGIN b_open --><span style="font-weight: bold"><!-- END b_open -->
<!-- BEGIN b_close --></span><!-- END b_close -->

<!-- BEGIN u_open --><span style="text-decoration: underline"><!-- END u_open -->
<!-- BEGIN u_close --></span><!-- END u_close -->

<!-- BEGIN i_open --><span style="font-style: italic"><!-- END i_open -->
<!-- BEGIN i_close --></span><!-- END i_close -->

<!-- BEGIN color_open --><span style="color: {COLOR}"><!-- END color_open -->
<!-- BEGIN color_close --></span><!-- END color_close -->

<!-- BEGIN size_open --><span style="font-size: {SIZE}px; line-height: normal"><!-- END size_open -->
<!-- BEGIN size_close --></span><!-- END size_close -->

<!-- BEGIN img --><img src="{URL}" border="0" /><!-- END img -->

<!-- BEGIN email --><a href="mailto:{EMAIL}">{EMAIL}</A><!-- END email -->

<!-- BEGIN mod_username_open --></span>
<table width="75%" cellspacing="1" cellpadding="3" border="1" align="center">
<tr> 
	  <td><span class="genmed"><b>{L_MOD} {L_BY}  {USERNAME}:</b></span></td>
	</tr>
	<tr>
	  <td class="mod"><!-- END quote_username_open -->
<!-- BEGIN mod_open --></span>
<table width="75%" cellspacing="1" cellpadding="3" border="1" align="center">
<tr> 
	  <td><span class="genmed"><b>{L_MOD}:</b></span></color></td>
	</tr>
	<tr>
	  <td class="mod"><!-- END mod_open -->
<!-- BEGIN mod_close --></td>
	</tr>
</table>
<span class="postbody"><!-- END mod_close -->


<!-- BEGIN intro_open -->
<div class="quotetitle"><b>{L_INTRO}:</b></div><div class="quotecontent"><!-- END intro_open -->
<!-- BEGIN intro_close -->
</div><!-- END intro_close -->

<!-- BEGIN glow_open --><span style="filter: glow(color={GLOWCOLOR}); height:20"><!-- END glow_open -->
<!-- BEGIN glow_close --></span><!-- END glow_close -->

<!-- BEGIN shadow_open --><span style="filter: shadow(color={SHADOWCOLOR}); height:20"><!-- END shadow_open -->
<!-- BEGIN shadow_close --></span><!-- END shadow_close -->

Posted: Tue Oct 12, 2004 3:37 pm
by markus_petrux
deny: Please, edit your previous post and replace the bbcode.tpl code. You have posted the one with my MOD applied again. :lol:

It seems a problem with nested HTML tags. In subSilver, all "boxed" BBCodes begin with </span> and end with <span class="postbody">. So, the BBCode depends on viewtopic.tpl.

I need to see your bbcode.tpl BEFORE applying my MOD to figure out what's going on.

Also, a URL would help.