 |
boardom b2 message board
|
View previous topic :: View next topic |
Author |
Message |
Sigg3
Joined: 03 Jul 2003 Posts: 895 Location: Oslo, Norway
|
Posted: Fri Jan 14, 2005 10:10 am Post subject: The img js script |
|
|
Centering is quite a bore in "real" html, but you can do it with this css:
Code: | <span class="imgcenter"><span class="centered"><img here></span></span> |
With a css stating:
Code: | .imgcenter {margin: auto;text-align: center;width: 100%;}
.centered {margin: auto;display: block;} |
But writing all that code to insert an image is just not my feeling of "easy post to blog" concepts. So I wanted to alter the existing [img] js button on b2edit since I've never used it anyway. Here's the altered array in b2quicktags.js:
Code: | Array('<b>','</b>','<i>','</i>','<u>','</u>','<strike>','</strike>','<blockquote>','</blockquote>','<p>','</p>','<li>','</li>','<span class="imgcenter"><span class="centered"></span></span>','','<a href="">','</a>'); |
But this doesn't work. A Java App prompts for url and ALT text. Does this has to do with the imgTag set to false (which it is by default)?
I'm just trying to swim here... _________________ Sigg3.net - You know you're worth it! | b2 Cafelog Resource Center | Fight my BattleImp! |
|
Back to top |
|
 |
stevem
Joined: 15 Mar 2003 Posts: 365
|
Posted: Fri Jan 14, 2005 3:24 pm Post subject: Re: The img js script |
|
|
Sigg3 wrote: | Code: | Array('<b>','</b>','<i>','</i>','<u>','</u>','<strike>','</strike>','<blockquote>'
,'</blockquote>','<p>','</p>','<li>','</li>','<span class="imgcenter"><span class="centered"></span></span>','','<a href="">','</a>'); |
|
Did you copy this wrongly? It ought to be:
Code: | Array('<b>','</b>','<i>','</i>','<u>','</u>','<strike>','</strike>','<blockquote>','</blockquote>'
,'<p>','</p>','<li>','</li>','<span class="imgcenter"><span class="centered">','</span></span>','<a href="">','</a>'); | so that the span code goes before and after any highlighted text. If you don't want a prompt, change
Code: | onClick="bblink(this.form,14)" | to Code: | onClick="bbstyle(this.form,14)" |
in b2quicktags.php
imageTag should be set to false because it's used later on to check if the tag needs closing.
At the start, with no text, it doesn't need closing so is false. |
|
Back to top |
|
 |
Sigg3
Joined: 03 Jul 2003 Posts: 895 Location: Oslo, Norway
|
Posted: Wed Jan 19, 2005 9:03 am Post subject: |
|
|
Cheers, I'll have a swing at it!
EDIT: It works superiorly! Cheers!
Now I can change <u> to <span class="u"> as well.
XHTML1.0 Str don't allow <u> for some reason.
EDIT 2: Oh, and what's this all about? from b2config.php
"# this would convert quotes into smart/curly quotes" _________________ Sigg3.net - You know you're worth it! | b2 Cafelog Resource Center | Fight my BattleImp! |
|
Back to top |
|
 |
Guest
|
Posted: Wed Jan 19, 2005 7:02 pm Post subject: |
|
|
Sigg3 wrote: | Oh, and what's this all about? from b2config.php
"# this would convert quotes into smart/curly quotes" |
It uses the phpcurlme function in b2functions.php to change straight quotes into curly ones, double and triple dashes are converted into em and en dashes. I can't show it here but you can see an example at http://cowpi.com/journal/templates/, two-thirds of the way down where it says SmartyPants v1.4.
Turn it on and see if you like the resulting text. |
|
Back to top |
|
 |
stevem
Joined: 15 Mar 2003 Posts: 365
|
Posted: Wed Jan 19, 2005 7:03 pm Post subject: |
|
|
That posting was from me but I got logged out!
Also see the green symbols 91,92,93,94,96,97 in the table at http://www.bbsinc.com/iso8859.html where it says Microsoft® Windows Latin-1 Added Characters in Green |
|
Back to top |
|
 |
Sigg3
Joined: 03 Jul 2003 Posts: 895 Location: Oslo, Norway
|
Posted: Thu Jan 20, 2005 12:47 pm Post subject: |
|
|
Seems brilliant, but I'm so used to writing ", &, é « and » that I almost forget myself when writing in word:p
I was just wondering wether it pre-formatted a <div> or <p> element to be styled (like those boxes with curly " in the top-left and bottom-right corners as bkgimages). But I can fix that myself. _________________ Sigg3.net - You know you're worth it! | b2 Cafelog Resource Center | Fight my BattleImp! |
|
Back to top |
|
 |
|
|
You can post new topics in this forum You can 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
|
Powered by phpBB 2 © 2001, 2002 phpBB Group
|