boardom Forum Index boardom
b2 message board
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The img js script

 
Post new topic   Reply to topic    boardom Forum Index -> (X)HTML / CSS help
View previous topic :: View next topic  
Author Message
Sigg3



Joined: 03 Jul 2003
Posts: 895
Location: Oslo, Norway

PostPosted: Fri Jan 14, 2005 10:10 am    Post subject: The img js script Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
stevem



Joined: 15 Mar 2003
Posts: 365

PostPosted: Fri Jan 14, 2005 3:24 pm    Post subject: Re: The img js script Reply with quote

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
View user's profile Send private message
Sigg3



Joined: 03 Jul 2003
Posts: 895
Location: Oslo, Norway

PostPosted: Wed Jan 19, 2005 9:03 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Guest






PostPosted: Wed Jan 19, 2005 7:02 pm    Post subject: Reply with quote

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

PostPosted: Wed Jan 19, 2005 7:03 pm    Post subject: Reply with quote

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
View user's profile Send private message
Sigg3



Joined: 03 Jul 2003
Posts: 895
Location: Oslo, Norway

PostPosted: Thu Jan 20, 2005 12:47 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    boardom Forum Index -> (X)HTML / CSS help All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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